Skip to content

Commit 8af8b3f

Browse files
Christopher-HermannBeckerWdf
authored andcommitted
NPE in StickyScrollControl.getStickyLineStyleRanges eclipse-platform#1964
When the sticky lines are styled, the linked text widget could already be disposed or null. In this case, the sticky lines must not be styled. Fixes eclipse-platform#1964
1 parent ea02800 commit 8af8b3f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ private String fillLineNumberWithLeadingSpaces(int lineNumber) {
217217

218218
private void styleStickyLines() {
219219
StyledText textWidget= sourceViewer.getTextWidget();
220+
if (textWidget == null || textWidget.isDisposed()) {
221+
return;
222+
}
220223

221224
List<StyleRange> stickyLinesStyleRanges= new ArrayList<>();
222225
int stickyLineTextOffset= 0;

0 commit comments

Comments
 (0)