Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
index 458769d15..d381aac13 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
@@ -175,15 +175,18 @@ public class RepositoryTreeNodeLabelProvider
} else if (element instanceof WorkingDirNode) {
newText += repository.getWorkTree().getAbsolutePath();
}
- StyleRange style = new StyleRange();
- style.start = textAfter.length();
- style.length = newText.length();
- StyledString.QUALIFIER_STYLER.applyStyles(style);
- StyleRange[] newRanges = new StyleRange[rangesAfter.length + 1];
- System.arraycopy(rangesAfter, 0, newRanges, 0, rangesAfter.length);
- newRanges[newRanges.length - 1] = style;
cell.setText(textAfter + newText);
- cell.setStyleRanges(newRanges);
+ if (rangesAfter != null) {
+ StyleRange style = new StyleRange();
+ style.start = textAfter.length();
+ style.length = newText.length();
+ StyledString.QUALIFIER_STYLER.applyStyles(style);
+ StyleRange[] newRanges = new StyleRange[rangesAfter.length + 1];
+ System.arraycopy(rangesAfter, 0, newRanges, 0,
+ rangesAfter.length);
+ newRanges[newRanges.length - 1] = style;
+ cell.setStyleRanges(newRanges);
+ }
} else {
updater.accept(cell);
}

Back to the top