   observeConfig: ->
     @subscriptions.add atom.config.onDidChange 'flex-tool-bar.persistentProjectToolBar', ({newValue}) =>
       @unregisterProjectWatch()
-      @resolveProjectConfigPath(undefined, newValue)
-      @registerProjectWatch()
+      if @resolveProjectConfigPath(undefined, newValue)
+        @registerProjectWatch()
       @reloadToolbar()
 
     @subscriptions.add atom.config.onDidChange 'flex-tool-bar.pollFunctionConditionsToReloadWhenChanged', ({oldValue, newValue}) =>

    @configWatcher?.close()
    @configWatcher = null

  registerWatch: ->
    return unless atom.config.get('flex-tool-bar.reloadToolBarWhenEditConfigFile') and @configFilePath

    @configWatcher?.close()
    @configWatcher = chokidar.watch @configFilePath

      @unregisterWatch()
      @unregisterProjectWatch()
      if newValue
        @registerWatch(true)
        @registerProjectWatch(true)

    @subscriptions.add atom.config.onDidChange 'flex-tool-bar.toolBarConfigurationFilePath', ({newValue}) =>
      @unregisterWatch()
      if @resolveConfigPath(newValue, false)
        @registerWatch()
      @reloadToolbar()

    @subscriptions.add atom.config.onDidChange 'flex-tool-bar.toolBarProjectConfigurationFilePath', ({newValue}) =>
      @unregisterProjectWatch()
      if @resolveProjectConfigPath(newValue)
        @registerProjectWatch()
      @reloadToolbar()

  resolveConfigPath: (configFilePath = atom.config.get('flex-tool-bar.toolBarConfigurationFilePath'), createIfNotFound = true) ->
