Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-08-23 17:42:40 -0400
committerJeff Johnston2018-08-24 14:43:27 -0400
commite37f17bad861a3d760f17302c3911630ac8889ac (patch)
tree130df618e8a765ebb7d40e12b0276a3544f29269
parent3ae1af9e883fccc75335a2a18dbb25372858b1ec (diff)
downloadorg.eclipse.linuxtools-e37f17bad861a3d760f17302c3911630ac8889ac.tar.gz
org.eclipse.linuxtools-e37f17bad861a3d760f17302c3911630ac8889ac.tar.xz
org.eclipse.linuxtools-e37f17bad861a3d760f17302c3911630ac8889ac.zip
Bug 538223 - NullPointerException in SpecOutlinePageAdapterFactory
- add null check to getAdapter in case adaption to IFile returns null Change-Id: Ib93a3eb3a31935c741d4788b20422ccbeaac4f58 Reviewed-on: https://git.eclipse.org/r/127966 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/outline/SpecOutlinePageAdapterFactory.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/outline/SpecOutlinePageAdapterFactory.java b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/outline/SpecOutlinePageAdapterFactory.java
index bc31ce5ed2..12ca0ea4bc 100644
--- a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/outline/SpecOutlinePageAdapterFactory.java
+++ b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/outline/SpecOutlinePageAdapterFactory.java
@@ -30,7 +30,7 @@ public class SpecOutlinePageAdapterFactory implements IAdapterFactory {
if (adaptableObject instanceof ExtensionBasedTextEditor || adaptableObject instanceof SpecfileEditor) {
ITextEditor specEditor = (ITextEditor) adaptableObject;
IFile editorFile = specEditor.getEditorInput().getAdapter(IFile.class);
- if (editorFile.getLocation().toOSString().endsWith(".spec")) { //$NON-NLS-1$
+ if (editorFile != null && editorFile.getLocation().toOSString().endsWith(".spec")) { //$NON-NLS-1$
SpecfileContentOutlinePage page = new SpecfileContentOutlinePage(specEditor);
page.setInput(specEditor.getEditorInput());
return (T) page;

Back to the top