         }
     }
 
-    private func syncStats(deck: Deck, statistic: Statistic) {
+    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
         }
 

                                           stat: statistic)
            } catch {
                Log.error?.message("Track-o-Bot error : \(error)")
            }
        }

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


    private func saveMatch(rank: Int, note: String, playerClass: CardClass,
                           opponentName: String, opponentClass: CardClass, opponentRank: Int) {
        DispatchQueue.main.async { [weak self] in
            guard let strong = self else { return }
            do {
                let realm = try Realm()
                let deck = realm.objects(Deck.self)
                    .filter("deckId = '\(strong.currentDeck?.id)'").first

                let statistic = Statistic()
                statistic.opponentName = opponentName
