diff --git "a/src/\360\237\220\237/disklist.js" "b/src/\360\237\220\237/disklist.js" index 8ab81b2..1ddf95a 100644 --- "a/src/\360\237\220\237/disklist.js" +++ "b/src/\360\237\220\237/disklist.js" @@ -109,11 +109,14 @@ class Helpers { } static getDriveLetter(index) { - driveLettersArray.forEach(dl => { // If no drive name, set the name to Unnamed Drive - if (dl.Label === null) dl.Label = "Unnamed Disk"; - }); - return driveLettersArray[index]; + if (driveLettersArray.length > 0) { + driveLettersArray.forEach(dl => { // If no drive name, set the name to Unnamed Drive + if (dl.Label === null) dl.Label = "Unnamed Disk"; + }); + return driveLettersArray[index]; + } } + static getDriveDescription(deviceName) { try { const udevadmOutput = execSync(`udevadm info --query=property --name=${deviceName}`).toString();