mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] NPE in MysqlHWIDProvider
This commit is contained in:
parent
5b77e4d8fd
commit
a65837d81d
1 changed files with 3 additions and 2 deletions
|
@ -72,7 +72,8 @@ private HardwareReportRequest.HardwareInfo fetchHardwareInfo(ResultSet set) thro
|
||||||
HardwareReportRequest.HardwareInfo hardwareInfo = new HardwareReportRequest.HardwareInfo();
|
HardwareReportRequest.HardwareInfo hardwareInfo = new HardwareReportRequest.HardwareInfo();
|
||||||
hardwareInfo.hwDiskId = set.getString(1);
|
hardwareInfo.hwDiskId = set.getString(1);
|
||||||
hardwareInfo.baseboardSerialNumber = set.getString(2);
|
hardwareInfo.baseboardSerialNumber = set.getString(2);
|
||||||
hardwareInfo.displayId = IOHelper.read(set.getBlob(3).getBinaryStream());
|
Blob displayId = set.getBlob(3);
|
||||||
|
hardwareInfo.displayId = displayId == null ? null : IOHelper.read(displayId.getBinaryStream());
|
||||||
hardwareInfo.bitness = set.getInt(4);
|
hardwareInfo.bitness = set.getInt(4);
|
||||||
hardwareInfo.totalMemory = set.getLong(5);
|
hardwareInfo.totalMemory = set.getLong(5);
|
||||||
hardwareInfo.logicalProcessors = set.getInt(6);
|
hardwareInfo.logicalProcessors = set.getInt(6);
|
||||||
|
@ -90,7 +91,7 @@ public void createHardwareInfo(HardwareReportRequest.HardwareInfo hardwareInfo,
|
||||||
s.setBlob(1, new ByteArrayInputStream(publicKey));
|
s.setBlob(1, new ByteArrayInputStream(publicKey));
|
||||||
s.setString(2, hardwareInfo.hwDiskId);
|
s.setString(2, hardwareInfo.hwDiskId);
|
||||||
s.setString(3, hardwareInfo.baseboardSerialNumber);
|
s.setString(3, hardwareInfo.baseboardSerialNumber);
|
||||||
s.setBlob(4, new ByteArrayInputStream(hardwareInfo.displayId));
|
s.setBlob(4, hardwareInfo.displayId == null ? null : new ByteArrayInputStream(hardwareInfo.displayId));
|
||||||
s.setInt(5, hardwareInfo.bitness);
|
s.setInt(5, hardwareInfo.bitness);
|
||||||
s.setLong(6, hardwareInfo.totalMemory);
|
s.setLong(6, hardwareInfo.totalMemory);
|
||||||
s.setInt(7, hardwareInfo.logicalProcessors);
|
s.setInt(7, hardwareInfo.logicalProcessors);
|
||||||
|
|
Loading…
Reference in a new issue