       @push()
       if (notifyOnFailure)
         @trigger("pushFailed", @failedPushCount >= 3 );
-      @pushDeferred.reject()
-      @pushDeferred = null
+      if @pushDeferred
+        @pushDeferred.reject()
+        @pushDeferred = null
 
     .done (response) =>
       

      
      @version = response.version
      @committedDiffs = []
      @pushDeferred.resolve()
      @pushDeferred = null
      return @pushDeferred

    @pushDeferred = new $.Deferred()
    # reject and null pushDeferred if the server didn't answer after 10 seconds
    setTimeout(((version) =>
      if @pushDeferred and version == @version
        @pushDeferred.reject()
        @pushDeferred = null
        console.error "Server did take too long to answer"),
      10000, @version)

    @committedDiffs = @committedDiffs.concat(@newDiffs)
    @newDiffs = []
