     server.on 'error', (error) -> console.error 'Application server failed', error
 
   deleteSocketFile: ->
-    return if process.platform is 'win32'
+    return if process.platform is 'win32' or not @socketPath?
 
     if fs.existsSync(@socketPath)
       try

  # the other launches will just pass their information to this server and then
  # close immediately.
  listenForArgumentsFromNewProcess: ->
    @deleteSocketFile()
    server = net.createServer (connection) =>
      connection.on 'data', (data) =>

  constructor: (options) ->
    {@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath} = options

    @socketPath = null if options.test

    global.atomApplication = this

    @pidsToOpenWindows = {}
