From 4c1ecc6512f81fa3f9ff3b504cbd10734bec02cb Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 14 Nov 2024 09:39:26 -0500 Subject: [PATCH] fix some null check errors in IT --- lib/pangea/choreographer/controllers/choreographer.dart | 5 ++--- lib/pangea/choreographer/controllers/it_controller.dart | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pangea/choreographer/controllers/choreographer.dart b/lib/pangea/choreographer/controllers/choreographer.dart index e35fdf4fc..1fdcad5a2 100644 --- a/lib/pangea/choreographer/controllers/choreographer.dart +++ b/lib/pangea/choreographer/controllers/choreographer.dart @@ -116,10 +116,9 @@ class Choreographer { // we've got a rather elaborate method of updating tokens after matches are accepted // so we need to check if the reconstructed text matches the current text // if not, let's get the tokens again and log an error - final reconstructedText = - PangeaToken.reconstructText(igc.igcTextData!.tokens); if (igc.igcTextData?.tokens != null && - reconstructedText.trim() != currentText.trim()) { + PangeaToken.reconstructText(igc.igcTextData!.tokens).trim() != + currentText.trim()) { if (kDebugMode) { PangeaToken.reconstructText( igc.igcTextData!.tokens, diff --git a/lib/pangea/choreographer/controllers/it_controller.dart b/lib/pangea/choreographer/controllers/it_controller.dart index f2d3e1ed4..097726588 100644 --- a/lib/pangea/choreographer/controllers/it_controller.dart +++ b/lib/pangea/choreographer/controllers/it_controller.dart @@ -146,6 +146,8 @@ class ITController { // ? _customInputTranslation(currentText) // : _systemChoiceTranslation(translationId)); + if (sourceText == null) return; + if (res.goldContinuances != null && res.goldContinuances!.isNotEmpty) { goldRouteTracker = GoldRouteTracker( res.goldContinuances!,