       @updateModifiedStatus()
 
     if typeof @item.onDidChangeModified is 'function'
-      @subscriptions.add @item.onDidChangeModified(modifiedHandler)
+      onDidChangeModifiedDisposable = @item.onDidChangeModified(modifiedHandler)
+      if Disposable.isDisposable(onDidChangeModifiedDisposable)
+        @subscriptions.add(onDidChangeModifiedDisposable)
+      else
+        console.warn "::onDidChangeModified does not return a valid disposable!"
     else if typeof @item.on is 'function'
       #TODO Remove once old events are no longer supported
       @item.on('modified-status-changed', modifiedHandler)

      @updateTooltip()

    if typeof @item.onDidChangeTitle is 'function'
      @subscriptions.add @item.onDidChangeTitle(titleChangedHandler)
    else if typeof @item.on is 'function'
      #TODO Remove once old events are no longer supported
      @item.on('title-changed', titleChangedHandler)

path = require 'path'
{$} = require 'atom-space-pen-views'
{Disposable, CompositeDisposable} = require 'atom'

module.exports =
class TabView extends HTMLElement
