Avoid tripping on an assertion after calling Dart_ListGetRange with zero length

This commit is contained in:
Chinmay Garde 2015-11-03 13:58:07 -08:00
parent ab0e7c524d
commit 3fbd90472e

View File

@ -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);