Skip to content

Commit bfb9fb4

Browse files
committed
fix : formatBytes test fail
1 parent 71e3db3 commit bfb9fb4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/devtools_app/lib/src/screens/network/utils/http_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int calculateHeadersSize(Map<String, Object?>? headers) {
3737
// Values are rounded to one decimal place for kB and MB.
3838
// Uses decimal (base-10) units to match Chrome DevTools.
3939
String formatBytes(int? bytes) {
40-
if (bytes == null) return '-';
40+
if (bytes == null || bytes < 0) return '-';
4141
if (bytes < 1000) return '$bytes B';
4242
if (bytes < 1000 * 1000) {
4343
return '${(bytes / 1000).toStringAsFixed(1)} kB';

0 commit comments

Comments
 (0)