       
       @version = response.version
       @committedDiffs = []
-      @pushDeferred.resolve()
-      @pushDeferred = null+      if @pushDeferred
+        @pushDeferred.resolve()
+        @pushDeferred = null
      @push()
      if (notifyOnFailure)
        @trigger("pushFailed", @failedPushCount >= 3 );
      @pushDeferred.reject()
      @pushDeferred = null

    .done (response) =>
      

          response = JSON.parse(responseObject.responseText)
        catch error
          console.error "parsing failed."
        if response?.messages?[0]?.error?
          if response.messages[0].error == "tracing.dirtyState"
            $(window).on(
              "beforeunload"
