core: fix null pointer in code annotations getter

This commit is contained in:
Skylot
2018-05-01 17:18:14 +03:00
parent 39093130a3
commit 20bfe83849
@@ -126,7 +126,11 @@ public final class JavaClass implements JavaNode {
private Map<CodePosition, Object> getCodeAnnotations() {
decompile();
return cls.getCode().getAnnotations();
CodeWriter code = cls.getCode();
if (code == null) {
return Collections.emptyMap();
}
return code.getAnnotations();
}
public Map<CodePosition, JavaNode> getUsageMap() {