     direction = e.direction  # 'left' or 'right'
     heroItem = $(e.relatedTarget)
     hero = _.find @heroes.models, (hero) -> hero.get('original') is heroItem.data('hero-id')
+    return console.error "Couldn't find hero from heroItem:", heroItem unless hero
     heroIndex = heroItem.index()
     @$el.find('.hero-indicator').each ->
       distance = Math.min 3, Math.abs $(@).index() - heroIndex

    'change #option-code-language': 'onCodeLanguageChanged'

  shortcuts:
    'left': -> @$el.find('#hero-carousel').carousel('prev') unless @$el.hasClass 'secret'
    'right': -> @$el.find('#hero-carousel').carousel('next') unless @$el.hasClass 'secret'

  constructor: (options) ->
    super options

    heroInfo = temporaryHeroInfo[hero.get('slug')]
    locked = heroInfo.status is 'Locked'
    hero = @loadHero hero, heroIndex
    @preloadHero heroIndex + 1
    @preloadHero heroIndex - 1
    @selectedHero = hero unless locked
    Backbone.Mediator.publish 'level:hero-selection-updated', hero: @selectedHero
    $('#choose-inventory-button').prop 'disabled', locked

  getFullHero: (original) ->
    url = "/db/thang.type/#{original}/version"
    if fullHero = @supermodel.getModel url
      return fullHero
    fullHero = new ThangType()
    fullHero.setURL url
    fullHero = (@supermodel.loadModel fullHero, 'thang').model
    fullHero

  preloadHero: (heroIndex) ->
    return unless hero = @heroes.models[heroIndex]
    @loadHero hero, heroIndex, true

  loadHero: (hero, heroIndex, preloading=false) ->
    createjs.Ticker.removeEventListener 'tick', stage for stage in _.values @stages
    if stage = @stages[heroIndex]
      unless preloading
        _.defer -> createjs.Ticker.addEventListener 'tick', stage  # Deferred, otherwise it won't start updating for some reason.
        @playSelectionSound hero
      return hero
    fullHero = @getFullHero hero.get 'original'
    onLoaded = =>
      return unless canvas = $(".hero-item[data-hero-id='#{fullHero.get('original')}'] canvas")
      canvas.prop width: @canvasWidth, height: @canvasHeight
