Skip to content

Commit a1e832f

Browse files
authored
Fix NPE in a task's dependency updated propagation. (#8806)
1 parent be5622f commit a1e832f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/lib/task/backend.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,13 @@ final class _TaskDataAccess {
13271327
return await withRetryTransaction(_db, (tx) async {
13281328
// Reload [state] within a transaction to avoid overwriting changes
13291329
// made by others trying to update state for another package.
1330-
final s = await tx.lookupValue<PackageState>(
1330+
final s = await tx.lookupOrNull<PackageState>(
13311331
PackageState.createKey(_db.emptyKey, runtimeVersion, package));
1332+
if (s == null) {
1333+
// No entry has been created yet, probably because of a new deployment rolling out.
1334+
// We can ignore it for now.
1335+
return false;
1336+
}
13321337
if (s.lastDependencyChanged!.isBefore(publishedAt)) {
13331338
tx.insert(
13341339
s

0 commit comments

Comments
 (0)