Better Compiler Error Handling

This commit is contained in:
Konloch 2021-07-06 23:11:49 -07:00
parent 9af03cb465
commit f3c7c1881a

View file

@ -79,20 +79,23 @@ public class ResourceViewPanel
nl + "Keep in mind most decompilers cannot produce compilable classes" +
nl + nl);
String text = textArea.getText();
byte[] compiledClass = compileMode.getCompiler().compile(text, viewer.cn.name);
if (compiledClass != null)
try
{
try {
String text = textArea.getText();
byte[] compiledClass = compileMode.getCompiler().compile(text, viewer.cn.name);
if (compiledClass != null)
{
ClassNode newNode = JarUtils.getNode(compiledClass);
BytecodeViewer.updateNode(viewer.cn, newNode);
errConsole.finished();
return true;
} catch (Exception e) {
e.printStackTrace();
}
}
catch (Exception e)
{
e.printStackTrace();
}
errConsole.pretty();
errConsole.setVisible(true);