Skip to content

Commit 22e2b2e

Browse files
committed
Correctly handle an unresolved object type
1 parent 6711dcf commit 22e2b2e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

visualvm/heapviewer.truffle/src/org/graalvm/visualvm/heapviewer/truffle/dynamicobject/DynamicObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ public static Instance getShape(Instance instance) {
155155

156156
@Override
157157
public String getType(Heap heap) {
158-
if (type == null) type = computeType(heap);
158+
if (type == null) {
159+
type = computeType(heap);
160+
if (type == null) type = "<unknown type>"; // NOI18N
161+
}
159162
return type;
160163
}
161164

visualvm/heapviewer.truffle/src/org/graalvm/visualvm/heapviewer/truffle/lang/python/PythonObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ public Instance getInstance() {
141141

142142
@Override
143143
public String getType(Heap heap) {
144-
if (type == null) type = DetailsUtils.getInstanceString(pythonClass, null);
144+
if (type == null) {
145+
type = DetailsUtils.getInstanceString(pythonClass, null);
146+
if (type == null) type = "<unknown type>"; // NOI18N
147+
}
145148
return type;
146149
}
147150

0 commit comments

Comments
 (0)