File tree Expand file tree Collapse file tree
bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -793,7 +793,7 @@ private void expandProjectionAnnotationsBorderingRegion(Region region) throws Ba
793793 for (Iterator <Annotation > it = fProjectionAnnotationModel .getAnnotationIterator (); it .hasNext ();) {
794794 Annotation annotation = it .next ();
795795 Position position = fProjectionAnnotationModel .getPosition (annotation );
796- if (bordersOrSurroundsRegion (position , region )) {
796+ if (position != null && bordersOrSurroundsRegion (position , region )) {
797797 fProjectionAnnotationModel .expand (annotation );
798798 }
799799 }
@@ -808,7 +808,7 @@ private void hideProjectionAnnotationsOutsideOfVisibleRegion() throws BadLocatio
808808
809809 private void hideProjectionAnnotationIfPartsAreOutsideOfVisibleRegion (Annotation annotation ) throws BadLocationException {
810810 Position position = fProjectionAnnotationModel .getPosition (annotation );
811- if (annotation instanceof ProjectionAnnotation a ) {
811+ if (annotation instanceof ProjectionAnnotation a && position != null ) {
812812 if (overlapsWithNonVisibleRegions (position .getOffset (), position .getLength ())) {
813813 a .setHidden (true );
814814 } else {
@@ -1355,6 +1355,9 @@ public IRegion computeCollapsedRegion(Position position) {
13551355 * @since 3.1
13561356 */
13571357 IRegion [] computeCollapsedRegions (Position position ) {
1358+ if (position == null ) {
1359+ return null ;
1360+ }
13581361 try {
13591362 IDocument document = getDocument ();
13601363 if (document == null ) {
You can’t perform that action at this time.
0 commit comments