Skip to content

Commit 88edadc

Browse files
committed
NPE in CONCAT_ROPE fixed - if 'left' and 'right' are null -> string is in 'bytes' similarly to ASCII_ROPE
1 parent 26f4891 commit 88edadc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

visualvm/heapviewer.truffle/src/org/graalvm/visualvm/heapviewer/truffle/lang/ruby/RubyDetailsProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ public String getDetailsString(String className, Instance instance) {
9393
Object vall = instance.getValueOfField("left"); // NOI18N
9494
Object valr = instance.getValueOfField("right"); // NOI18N
9595

96+
if (vall == null && valr == null) {
97+
// string in 'bytes' similarly to ASCII_ROPE
98+
Integer len = (Integer) instance.getValueOfField("byteLength"); // NOI18N
99+
return getByteArrayFieldString(instance, "bytes", 0, len.intValue(), "..."); // NOI18N
100+
}
96101
String left = DetailsUtils.getInstanceString((Instance)vall);
97102

98103
if (left == null) {

0 commit comments

Comments
 (0)