[infra] fix approve_results crashing on bad preapproval entry

This may not be the correct fix, but it seems to prevent the crash
that's currently affecting several build bots. Not sure where the bad
approval entry came from.

Change-Id: Iac683f01c4d0750103b190f8ab289f8374eedf6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97685
Reviewed-by: William Hesse <whesse@google.com>
diff --git a/tools/approve_results.dart b/tools/approve_results.dart
index 1b105af..989457c 100755
--- a/tools/approve_results.dart
+++ b/tools/approve_results.dart
@@ -88,7 +88,7 @@
   Map<String, dynamic> get _sharedData =>
       resultData ?? baselineData ?? approvedResultData;
   String get name => _sharedData["name"];
-  String get configuration => _sharedData["configuration"];
+  String get configuration => _sharedData["configuration"] ?? "";
   String get key => "$configuration:$name";
   String get expected => _sharedData["expected"];
   String get result => (resultData ?? const {})["result"];
@@ -872,7 +872,7 @@
     for (final test in tests) {
       if (test.approvedResultData == null) continue;
       if (test.result == null &&
-          test.approvedResultData["preapprovals"].isEmpty) continue;
+          (test.approvedResultData["preapprovals"] ?? "").isEmpty) continue;
       final approvalData = deepClone(test.approvedResultData);
       // TODO(https://github.com/dart-lang/sdk/issues/36279): Remove needless
       // fields that shouldn't be in the approvals data. Remove this 2019-04-03.