Take care of listing devices on Linux when model is null.

This commit is contained in:
2017-09-11 06:03:11 +01:00
parent 7d782fe3da
commit 489ca6d1de

View File

@@ -100,6 +100,8 @@ namespace DiscImageChef.Devices.Linux
} }
if(string.IsNullOrEmpty(devices[i].vendor) || devices[i].vendor == "ATA") if(string.IsNullOrEmpty(devices[i].vendor) || devices[i].vendor == "ATA")
{
if(devices[i].model != null)
{ {
string[] pieces = devices[i].model.Split(' '); string[] pieces = devices[i].model.Split(' ');
if(pieces.Length > 1) if(pieces.Length > 1)
@@ -108,6 +110,7 @@ namespace DiscImageChef.Devices.Linux
devices[i].model = devices[i].model.Substring(pieces[0].Length + 1); devices[i].model = devices[i].model.Substring(pieces[0].Length + 1);
} }
} }
}
// TODO: Get better device type from sysfs paths // TODO: Get better device type from sysfs paths
if(string.IsNullOrEmpty(devices[i].bus)) if(string.IsNullOrEmpty(devices[i].bus))