Merge fix for 121
authorKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Fri, 24 Aug 2012 12:30:07 +0000 (16:30 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Fri, 24 Aug 2012 12:30:07 +0000 (16:30 +0400)
plugins/git4idea/src/git4idea/push/GitPusher.java

index 7f73d7bdb5c81bd678513565864e37aa9de68c63..9968fedb790af5451ebe5c31dc82684499980b13 100644 (file)
@@ -502,8 +502,11 @@ public final class GitPusher {
   }
 
   private void saveUpdateSettings(@NotNull UpdateSettings updateSettings) {
-    myPushSettings.setUpdateAllRoots(updateSettings.shouldUpdateAllRoots());
-    myPushSettings.setUpdateMethod(updateSettings.getUpdateMethod());
+    UpdateMethod updateMethod = updateSettings.getUpdateMethod();
+    if (updateMethod != null) { // null if user has pressed cancel
+      myPushSettings.setUpdateAllRoots(updateSettings.shouldUpdateAllRoots());
+      myPushSettings.setUpdateMethod(updateMethod);
+    }
   }
 
   @NotNull