Skip to content

Commit 658f710

Browse files
committed
fix getAllSubWindowIds assertion if there is no sub windows
1 parent a93a267 commit 658f710

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/desktop_multi_window/lib/desktop_multi_window.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ class DesktopMultiWindow {
7676
final result = await miltiWindowChannel
7777
.invokeMethod<List<dynamic>>('getAllSubWindowIds');
7878
final ids = result?.cast<int>() ?? const [];
79-
assert(ids.isNotEmpty);
80-
assert(ids.every((id) => id > 0));
8179
assert(!ids.contains(0), 'ids must not contains main window id');
80+
assert(ids.every((id) => id > 0), 'id must be greater than 0');
8281
return ids;
8382
}
8483
}

0 commit comments

Comments
 (0)