Bug 559083 - Observed NPE at
org.eclipse.jdt.internal.debug.core.model.JDIStackFrame:956

Change-Id: I9c10a66cff156a7b18e71bfc738282bfee8ecfb7
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
index 87af6ba..7fc366c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -951,7 +951,7 @@
 	 */
 	protected ObjectReference getUnderlyingThisObject() throws DebugException {
 		synchronized (fThread) {
-			if ((fStackFrame == null || fThisObject == null) && !isStatic()) {
+			if ((fStackFrame == null || fThisObject == null) && !isStatic() && !(getUnderlyingStackFrame() == null)) {
 				try {
 					fThisObject = getUnderlyingStackFrame().thisObject();
 				} catch (RuntimeException e) {