disklayout() fix catch error macOS

This commit is contained in:
Sebastian Hildebrandt
2025-08-25 18:15:34 +02:00
parent 941ca85cf8
commit 9e5779ae3d
5 changed files with 14 additions and 15 deletions
+3
View File
@@ -755,6 +755,9 @@ function getCpu() {
modelline = util.cleanString(modelline);
const modellineParts = modelline.split('@');
result.brand = modellineParts[0].trim();
if (result.brand.indexOf('Unknown') >= 0) {
result.brand = result.brand.split('Unknown')[0].trim();
}
result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;
if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {
result.speed = getAMDSpeed(result.brand);
+4 -14
View File
@@ -1416,23 +1416,13 @@ function diskLayout(callback) {
}
}
});
for (let i = 0; i < result.length; i++) {
delete result[i].BSDName;
}
if (callback) {
callback(result);
}
resolve(result);
commitResult(result);
});
} else {
for (let i = 0; i < result.length; i++) {
delete result[i].BSDName;
}
if (callback) {
callback(result);
}
resolve(result);
commitResult(result);
}
} else {
commitResult(result);
}
});
}