mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Исправлена проблема с NPE при HWID compareMode
This commit is contained in:
parent
b16cd0cc67
commit
5ad5795a62
2 changed files with 2 additions and 1 deletions
|
@ -151,6 +151,7 @@ public void onCheckInfo(OshiHWID hwid, String username, Connection c) throws HWI
|
|||
db_hwid.processorID = set.getString(hwidFieldProcessorID);
|
||||
db_hwid.HWDiskSerial = set.getString(hwidFieldHWDiskSerial);
|
||||
db_hwid.totalMemory = Long.valueOf(set.getString(hwidFieldTotalMemory));
|
||||
db_hwid.macAddr = "";
|
||||
LogHelper.dev("Compare HWID: %s vs %s", hwid.getSerializeString(), db_hwid.getSerializeString());
|
||||
int compare_point = hwid.compare(db_hwid);
|
||||
if(compare_point < compare) continue;
|
||||
|
|
|
@ -43,7 +43,7 @@ public int compare(HWID hwid) {
|
|||
if(oshi.HWDiskSerial.equals(HWDiskSerial)) rate+=45;
|
||||
if(oshi.processorID.equals(processorID)) rate+=18;
|
||||
if(oshi.serialNumber.equals(serialNumber)) rate+=15;
|
||||
if(oshi.macAddr.equals(macAddr)) rate+=19;
|
||||
if(!oshi.macAddr.isEmpty() && oshi.macAddr.equals(macAddr)) rate+=19;
|
||||
return rate;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue