-
Notifications
You must be signed in to change notification settings - Fork 151
Description
When calling statObject method with a valid, existent bucket and object key crashes with Null check operator used on a null value at following line:
return StatObjectResult(
etag: etag,
size: int.parse(resp.headers['content-length']!), // <------ Here
metaData: extractMetadata(resp.headers),
lastModified: parseRfc7231Time(resp.headers['last-modified']!),
acl: retrieveAcls ? await getObjectACL(bucket, object) : null,
);Stacktrace:
Null check operator used on a null value
#0 Minio.statObject (package:minio/src/minio.dart:1136:53)
<asynchronous suspension>
#1 Future.timeout.<anonymous closure> (dart:async/future_impl.dart:1061:7)
<asynchronous suspension>
I debugged it and turns out, resp.headers is missing content-length field, hence the crash. I also noticed that size is a nullable param. So this can easily be solved by using int.tryParse instead of int.parse (Unless it is a real deep issue!).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels