Fix for Bug 10741, NPE when saving bld.inf and mmp files. RCL_2_4
authorstechong
Thu, 25 Feb 2010 23:47:43 -0600
branchRCL_2_4
changeset 1032 083e0a53ef29
parent 1031 fffb59e2ff57
child 1034 42eaaa076776
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 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);
+				}
 			}
 		}
 	}