     xhr = new Dropbox.Xhr 'POST', "#{@urls.restore}/#{@urlEncodePath(path)}"
     xhr.setParams(rev: versionTag).signWithOauth @oauth
     @dispatchXhr xhr, (error, metadata) ->
-      callback error, Dropbox.Stat.parse(metadata)
+      callback error, Dropbox.Stat.parse(metadata) if callback
 
   # Alias for "revertFile" that matches the HTTP API.
   restore: (path, versionTag, callback) ->

  #   a file with the same name that already exsits; instead the contents
  #   will be written to a similarly named file (e.g. "notes (1).txt"
  #   instead of "notes.txt")
  # @param {function(?Dropbox.ApiError, ?Dropbox.Stat)} callback called with
  #   the result of the /files (POST) HTTP request; the second paramter is a
  #   Dropbox.Stat instance describing the newly created file, and the first
  #   parameter is null

    delete params.file

    @dispatchXhr xhr, (error, metadata) ->
      callback error, Dropbox.Stat.parse(metadata) if callback

  # writeFile implementation that uses the /files_put API.
  #
