You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
statObject method is crashing with Error: Null check operator used on a null value #108
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!).
Fixed in the fork. statObject no longer reads content-length and last-modified with the bang operator — both are optional in a HEAD answer,
so both are parsed defensively and the result fields stay nullable:
final contentLength = resp.headers['content-length'];
final lastModified = resp.headers['last-modified'];
A regression test named after this issue is in test/minio_regressions_test.dart.
Activity
Use tryParse for content-length header
fix: handle missing content-length header in statObject (xtyxtyx#108)
arrrrny commentedon Oct 22, 2026
Fixed in the fork.
statObjectno longer readscontent-lengthandlast-modifiedwith the bang operator — both are optional in a HEAD answer,so both are parsed defensively and the result fields stay nullable:
A regression test named after this issue is in
test/minio_regressions_test.dart.arrrrny commentedon Oct 22, 2026
This ships in zuraffa_minio — the maintained fork of this package, which upstream has not touched since August 2025.
The fork keeps the API of the original package unchanged, so moving over is an import swap:
Source, the changelog and the sweep of the open issues of this tracker: https://github.com/arrrrny/zuraffa_minio