 
     private func saveMatch(rank: Int, note: String, playerClass: CardClass,
                            opponentName: String, opponentClass: CardClass, opponentRank: Int) {
-        guard let currentDeck = self.currentDeck else {
-            Log.info?.message("No deck, ignore statistic")
-            return
-        }
-
         DispatchQueue.main.async { [weak self] in
             guard let strong = self else { return }
             do {
                 let realm = try Realm()
-                guard let deck = realm.objects(Deck.self)
-                    .filter("deckId = '\(currentDeck.id)'").first else {
-                        Log.error?.message("Can not get deck")
-                        return
-                }
+                let deck = realm.objects(Deck.self)
+                    .filter("deckId = '\(strong.currentDeck?.id)'").first
 
                 let statistic = Statistic()
                 statistic.opponentName = opponentName

                    }

                    if Settings.instance.autoArchiveArenaDeck &&
                        strong.currentGameMode == .arena &&
                        deck.isArena && deck.arenaFinished() {
                        deck.isActive = false
                    }
                    
                    deck.statistics.append(statistic)
                }
                strong.syncStats(deck: deck, statistic: statistic)
            } catch {

        }
    }

    private func syncStats(deck: Deck?, statistic: Statistic) {
        guard currentGameMode != .practice && currentGameMode != .none else {
            Log.info?.message("Game was in \(currentGameMode), don't send to third-party")
            return
        }

        if Settings.instance.hsReplaySynchronizeMatches {
            HSReplayAPI.getUploadToken { (token) in
                LogUploader.upload(logLines: self.powerLog, game: self, statistic: statistic) {
                    result in
                    if case UploadResult.successful(let replayId) = result {
                        self.showNotification(type: .hsReplayPush(replayId: replayId))
                        NotificationCenter.default
                            .post(name: Notification.Name(rawValue: "reload_decks"), object: nil)
                    }
                }
            }
        }

        guard let deck = deck else {
            Log.info?.message("Not uploading game to HearthStats, TrackoBot: no current deck set")
            return
        }

