 
       didImageLoad = (e) ->
         $img = jQuery(@)
-        $img.off('load.image-view', didImageLoad)
 
         #Do nothing if view instance is destroyed
         return if get(view, 'isDestroyed')
 
         #Do nothing if src has changed again since loading began
         current = get(view, 'src') ? ''
-        loaded = $img.attr('src').substr(-(current.length))
+        loaded = $img.attr('src')?.substr(-(current.length))
         return unless loaded is current
 
         set(view, 'loading', false) if $img.prop 'complete' #exit loading state

    @chainable
  ###
  updateSrc: ->
    $img = @$()
    src = get(@, 'src')
    didImageLoad = get @, 'didImageLoad'

    $img.removeAttr 'src'

    # Do nothing if the src property is blank
    return @ if isBlank(src)

    set @, 'loading', true #enter loading state

    $img.on('load.image-view', didImageLoad)
    $img.attr('src', src)
    didImageLoad.call($img) if $img.prop 'complete'
    @

  ###


    @property loading
    @type Boolean
    @default true
  ###
  loading: true

  ###
    The src path (URL) of the image to display in this element.
