             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()

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

namespace 'kksystem.cardsets.study.single_box', (ns) ->

            unless cards
              kksystem.cardsets.study.error()
              return
            #Cardbox contains fetched cards which have not yet been studied.
            current_box.cards = cards.filter (card) ->
              ns.card_ids_studied.indexOf(card.id) == -1
            ns.displayNextCard()
          )
        #Abort. Function will be re-run asynchronously and will not take this
