diff --git a/src/main/java/me/grax/jbytemod/decompiler/Decompiler.java b/src/main/java/me/grax/jbytemod/decompiler/Decompiler.java index cece636..03f7a0b 100644 --- a/src/main/java/me/grax/jbytemod/decompiler/Decompiler.java +++ b/src/main/java/me/grax/jbytemod/decompiler/Decompiler.java @@ -55,7 +55,12 @@ protected String decompile(ClassNode cn, MethodNode mn) { // do not regenerate anything here ClassWriter cw = new ClassWriter(0); cn.accept(cw); - return decompile(cw.toByteArray(), mn); + try{ + return decompile(cw.toByteArray(), mn); + }catch(Exception exception){ + return "Failed to decompile, reason: " + exception.getMessage(); + } + } public abstract String decompile(byte[] b, MethodNode mn);