[infra] Fix auto-approval breaking as of per-CL approval.

The matches getter could crash if there was no result but there were approved
results or baseline results. Instead fall back on the matches field from
the baseline or approved results.

TBR=whesse@google.com

Change-Id: Ic57a2833dccb85dd69f2eba5a82bc8a0f7efa2c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97622
Reviewed-by: Jonas Termansen <sortie@google.com>
diff --git a/tools/approve_results.dart b/tools/approve_results.dart
index c577d5d..ac7e19f 100755
--- a/tools/approve_results.dart
+++ b/tools/approve_results.dart
@@ -92,7 +92,7 @@
   String get key => "$configuration:$name";
   String get expected => _sharedData["expected"];
   String get result => (resultData ?? const {})["result"];
-  bool get matches => resultData["matches"];
+  bool get matches => _sharedData["matches"];
   String get baselineResult => (baselineData ?? const {})["result"];
   String get approvedResult => (approvedResultData ?? const {})["result"];
   bool get isDifferent => result != null && result != baselineResult;