mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Avoid tripping on an assertion after calling Dart_ListGetRange with zero length
This commit is contained in:
parent
ab0e7c524d
commit
3fbd90472e
@ -288,6 +288,11 @@ struct DartConverter<Vector<T>> {
|
||||
return result;
|
||||
intptr_t length = 0;
|
||||
Dart_ListLength(handle, &length);
|
||||
|
||||
if (length == 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result.reserveCapacity(length);
|
||||
|
||||
Vector<Dart_Handle> items(length);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user