disklayout() fix catch error macOS
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user