Fix for Bug 10741, NPE when saving bld.inf and mmp files.
--- 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);
+ }
}
}
}