mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix possible nullreference with usb devices.
This commit is contained in:
@@ -462,8 +462,10 @@ namespace DiscImageChef.Devices
|
|||||||
if (Directory.Exists("/sys/block/" + devPath))
|
if (Directory.Exists("/sys/block/" + devPath))
|
||||||
{
|
{
|
||||||
var resolvedLink = Linux.Command.ReadLink("/sys/block/" + devPath);
|
var resolvedLink = Linux.Command.ReadLink("/sys/block/" + devPath);
|
||||||
resolvedLink = "/sys" + resolvedLink.Substring(2);
|
|
||||||
if (!string.IsNullOrEmpty(resolvedLink))
|
if (!string.IsNullOrEmpty(resolvedLink))
|
||||||
|
{
|
||||||
|
resolvedLink = "/sys" + resolvedLink.Substring(2);
|
||||||
|
|
||||||
while (resolvedLink.Contains("usb"))
|
while (resolvedLink.Contains("usb"))
|
||||||
{
|
{
|
||||||
resolvedLink = Path.GetDirectoryName(resolvedLink);
|
resolvedLink = Path.GetDirectoryName(resolvedLink);
|
||||||
@@ -516,6 +518,7 @@ namespace DiscImageChef.Devices
|
|||||||
IsUsb = true;
|
IsUsb = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user