             Log.error?.message("Error accessing Realm database")
             return nil
         }
-        
-        return Array(realm.objects(Deck.self))
+		
+		let decks = Array(realm.objects(Deck.self))
+		
+		for deck in decks {
+			RealmHelper.validateCardCounts(deck)
+		}
+		return decks
     }
 	
 	static func getActiveDecks() -> [CardClass: [Deck]]? {

			if decks[deck.playerClass] == nil {
				decks[deck.playerClass] = [Deck]()
			}
			decks[deck.playerClass]?.append(deck)
		}
		return decks

		Realm.Configuration.defaultConfiguration = config
	}
	
	// MARK: - Deck operations
	
	static func getDeck(with id: String) -> Deck? {
