Skip to content

Commit

Permalink
[NETBEANS-2559] Avoid NPE when openjfx
Browse files Browse the repository at this point in the history
  • Loading branch information
errael committed Mar 6, 2020
1 parent b42e874 commit 1ef6c46
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ private static void componentParentChanged(JPDADebugger debugger, JPDABreakpoint
*/
private static void setFxDebug(VirtualMachine vm, ThreadReference tr) {
ClassType sysPropClass = getClass(vm, tr, "com.sun.javafx.runtime.SystemProperties");
if(sysPropClass == null) {
// openjfx doesn't have runtime.SystemProperties.isDebug
return;
}
try {
Field debugFld = ReferenceTypeWrapper.fieldByName(sysPropClass, "isDebug"); // NOI18N
sysPropClass.setValue(debugFld, VirtualMachineWrapper.mirrorOf(vm, true));
Expand All @@ -474,7 +478,7 @@ private static ClassType getClass(VirtualMachine vm, ThreadReference tr, String
if (t instanceof ClassType) {
return (ClassType)t;
}
logger.log(Level.WARNING, "{0} is not a class but {1}", new Object[]{name, t}); // NOI18N
// logger.log(Level.WARNING, "{0} is not a class but {1}", new Object[]{name, t}); // NOI18N
return null;
}

Expand Down

0 comments on commit 1ef6c46

Please sign in to comment.