File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -165,17 +165,17 @@ class Disk extends Equatable {
165
165
final scsi =
166
166
RegExp (r"/^(sata|scsi|ata|ide|pci)$/i" ).hasMatch (device["tran" ] ?? "" );
167
167
final usb = RegExp (r"/^(usb)$/i" ).hasMatch (device["tran" ] ?? "" );
168
- final readonly = device["ro" ] == 1 ;
169
- final removable = device["rm" ] == 1 || device["hotplug" ] == 1 || virtual;
168
+ final readonly = device["ro" ]? . toString () == '1' ;
169
+ final removable = device["rm" ]? . toString () == '1' || device["hotplug" ]? . toString () == '1' || virtual;
170
170
171
171
return Disk (
172
172
busType: (device["tran" ] ?? "UNKNOWN" ).toUpperCase (),
173
173
device: name ?? "" ,
174
174
raw: kname ?? name ?? "" ,
175
175
description: getDescription (),
176
- size: device["size" ],
177
- blockSize: device["phy-sec" ] ?? 512 ,
178
- logicalBlockSize: device["log-sec" ] ?? 512 ,
176
+ size: int . tryParse ( device["size" ]? . toString () ?? "" ) ,
177
+ blockSize: int . tryParse ( device["phy-sec" ]? . toString () ?? "" ) ?? 512 ,
178
+ logicalBlockSize: int . tryParse ( device["log-sec" ]? . toString () ?? "" ) ?? 512 ,
179
179
mountpoints: ((device["children" ] ?? [device]) as List )
180
180
.where ((mountpoint) => mountpoint["mountpoint" ] != null )
181
181
.map ((mountpoint) => Mountpoint .fromLsblk (mountpoint))
You can’t perform that action at this time.
0 commit comments