[cloud functions] Fix error when a landed CL has no tryjobs

TBR: athom@google.com
Change-Id: If3ac92b797dcf60c3633e318b9a6ea0921b58fe1
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/131862
Reviewed-by: William Hesse <whesse@google.com>
diff --git a/functions/node/firestore_impl.dart b/functions/node/firestore_impl.dart
index 57a1445..a0454dd 100644
--- a/functions/node/firestore_impl.dart
+++ b/functions/node/firestore_impl.dart
@@ -313,6 +313,7 @@
         .orderBy('number', descending: true)
         .limit(1)
         .get();
+    if (patchsets.isEmpty) return [];
     final lastPatchsetGroup =
         patchsets.documents.first.data.getInt('patchset_group');
     QuerySnapshot approvals = await firestore