diff options
author | vrubezhny | 2015-04-08 14:01:25 +0000 |
---|---|---|
committer | Nick Sandonato | 2015-04-22 23:12:09 +0000 |
commit | 80a2bff5fe66fc28253431adabd6b14e9c649354 (patch) | |
tree | 1ffc37e9201ea9e7f493ea4133f114450f7365af | |
parent | 54175062ae227582e53e9a22b2f0893bbdaf1875 (diff) | |
download | webtools.sourceediting-80a2bff5fe66fc28253431adabd6b14e9c649354.tar.gz webtools.sourceediting-80a2bff5fe66fc28253431adabd6b14e9c649354.tar.xz webtools.sourceediting-80a2bff5fe66fc28253431adabd6b14e9c649354.zip |
Bug 464161 - NPE in StructuredTextEditor.update (3091)
When a file is being refactored, it's possible that no more Structured Model could be created on a file that is a result of refactoring.
As such, it's possible that StructuredTextEditor.getInternalModel() will return null, so the result of getInternalModel() call is to be checked against null.
Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r-- | bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java index 0cdac06684..8a6d5a41e5 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2013 IBM Corporation and others. + * Copyright (c) 2001, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -3088,7 +3088,8 @@ public class StructuredTextEditor extends TextEditor { ContentOutlineConfiguration cfg = createContentOutlineConfiguration(); ((ConfigurableContentOutlinePage) fOutlinePage).setConfiguration(cfg); IStructuredModel internalModel = getInternalModel(); - ((ConfigurableContentOutlinePage) fOutlinePage).setInputContentTypeIdentifier(internalModel.getContentTypeIdentifier()); + ((ConfigurableContentOutlinePage) fOutlinePage).setInputContentTypeIdentifier( + internalModel == null ? null : internalModel.getContentTypeIdentifier()); ((ConfigurableContentOutlinePage) fOutlinePage).setInput(internalModel); } if (fPropertySheetPage != null && fPropertySheetPage instanceof ConfigurablePropertySheetPage) { |