# HG changeset patch # User stechong # Date 1267163263 21600 # Node ID 083e0a53ef298318f3821fc713aeaed88ba247b4 # Parent fffb59e2ff5735eae5d59951b28efd26f24586be Fix for Bug 10741, NPE when saving bld.inf and mmp files. diff -r fffb59e2ff57 -r 083e0a53ef29 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 15:41:07 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:47:43 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); + } } } }