# HG changeset patch # User stechong # Date 1267163435 21600 # Node ID f609c2dffcb6e81fb0067983daa5dcda727fc2e6 # Parent 0970d96e01ad187cfe0350ed477966377eb8ac17 Fix for Bug 10741, NPE when saving bld.inf and mmp files. diff -r 0970d96e01ad -r f609c2dffcb6 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/common/CarbideFormEditor.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/common/CarbideFormEditor.java Thu Feb 25 12:16:00 2010 -0600 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/common/CarbideFormEditor.java Thu Feb 25 23:50:35 2010 -0600 @@ -410,7 +410,10 @@ protected void commitView() { try { committingView = true; - getView().commit(); + IView view = getView(); + if (view != null) { + view.commit(); + } } finally { committingView = false; } @@ -583,12 +586,15 @@ } catch (CoreException x) { ProjectUIPlugin.log(x); } - IMessage[] messages = getView().getMessages(); - IPath modelPath = file.getLocation(); - for (IMessage message : messages) { - // TODO: at a later point we should add markers to the #included files too, once we determine the proper way to clear them. - if (message.getLocation() != null && message.getLocation().equals(modelPath)) - message.createMarker(file, CarbideFormEditorMarker.FORMEDITOR_PROBLEM_MARKER); + IView view = getView(); + if (view != null) { + IMessage[] messages = view.getMessages(); + IPath modelPath = file.getLocation(); + for (IMessage message : messages) { + // TODO: at a later point we should add markers to the #included files too, once we determine the proper way to clear them. + if (message.getLocation() != null && message.getLocation().equals(modelPath)) + message.createMarker(file, CarbideFormEditorMarker.FORMEDITOR_PROBLEM_MARKER); + } } } }