Fix for Bug 10741, NPE when saving bld.inf and mmp files.
authorstechong
Thu, 25 Feb 2010 23:50:35 -0600
changeset 1033 f609c2dffcb6
parent 1025 0970d96e01ad
child 1036 b1909e47f4af
Fix for Bug 10741, NPE when saving bld.inf and mmp files.
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);
+				}
 			}
 		}
 	}