             kksystem.models.Card.load [['cardset_id', 'eq', params.cardset], \
                 ['current_cardbox_id', 'eq', null], \
                 [null, 'order', 'rand']], (cards) =>
+              unless cards
+                kksystem.cardsets.study.error()
+                return
               @cardboxes.push({cards})
               ns.displayNextCard()
           else
             ns.displayNextCard()
+        else
+          ns.displayNextCard()
 
   ns.displayNextCard = ->
     kksystem.cardsets.study.startLoading()


namespace 'kksystem.cardsets.study.normal', (ns) ->
  ns.init = (params) ->
    kksystem.models.Cardset.load [['id', 'eq', params.cardset]], (cardsets) =>
      if cardsets and cardsets.length > 0
        @cardset = cardsets[0]

        kksystem.cardsets.study.error()
        return
      ns.use_card.done = true
      ns.card_ids_studied.push(ns.use_card.id)
      ns.displayNextCard()

  ns.incorrect = ->
