Skip to content

Commit 389f117

Browse files
committed
TranscriptScreen: guard against null rowColorBuffer when getting transcript
This occurs, for instance, when we try to retrieve text from the transcript without caring about color information. Fixes crash when selecting/copying text introduced by 54d2530... ("Make blank lines track the current foreground/background color.").
1 parent 230c04b commit 389f117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/emulatorview/src/jackpal/androidterm/emulatorview/TranscriptScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private String internalGetTranscriptText(GrowableIntArray colors, int selX1, int
350350
char c = line[i];
351351
if (c == 0) {
352352
break;
353-
} else if (c != ' ' || (rowColorBuffer.get(column) != defaultColor)) {
353+
} else if (c != ' ' || ((rowColorBuffer != null) && (rowColorBuffer.get(column) != defaultColor))) {
354354
lastPrintingChar = i;
355355
}
356356
if (!Character.isLowSurrogate(c)) {

0 commit comments

Comments
 (0)