mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-20 10:13:17 +00:00
Fixed a bug, where if a dmi entry was empty, it prevented the other entries from getting decoded
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -72,17 +72,21 @@ function linux_identifiers()
|
||||
if (!require('fs').existsSync('/sys/class/dmi/id')) { throw ('this platform does not have DMI statistics'); }
|
||||
|
||||
var entries = require('fs').readdirSync('/sys/class/dmi/id');
|
||||
entries = null;
|
||||
|
||||
for(var i in entries)
|
||||
{
|
||||
if (require('fs').statSync('/sys/class/dmi/id/' + entries[i]).isFile())
|
||||
{
|
||||
try
|
||||
{
|
||||
ret[entries[i]] = require('fs').readFileSync('/sys/class/dmi/id/' + entries[i]).toString().trim();
|
||||
|
||||
}
|
||||
catch(z)
|
||||
{
|
||||
}
|
||||
if (ret[entries[i]] == 'None') { delete ret[entries[i]];}
|
||||
}
|
||||
}
|
||||
entries = null;
|
||||
|
||||
identifiers['bios_date'] = ret['bios_date'];
|
||||
identifiers['bios_vendor'] = ret['bios_vendor'];
|
||||
|
||||
Reference in New Issue
Block a user