Skip to content

Commit

Permalink
Fixed NPE in tracker ip addr (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Nov 14, 2022
1 parent d8a7fa9 commit e349440
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/main/java/dev/slimevr/protocol/DataFeedBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@ public static int createHardwareInfo(FlatBufferBuilder fbb, Device device) {
HardwareInfo.startHardwareInfo(fbb);
HardwareInfo.addFirmwareVersion(fbb, nameOffset);
HardwareInfo.addManufacturer(fbb, manufacturerOffset);
HardwareInfo
.addIpAddress(
fbb,
Ipv4Address
.createIpv4Address(
fbb,
ByteBuffer.wrap(device.getIpAddress().getAddress()).getInt()
)
);
var ipAddr = device.getIpAddress();
if (ipAddr != null && ipAddr.getAddress() != null) {
HardwareInfo
.addIpAddress(
fbb,
Ipv4Address
.createIpv4Address(
fbb,
ByteBuffer.wrap(ipAddr.getAddress()).getInt()
)
);
}
// BRUH MOMENT
// TODO need support: HardwareInfo.addHardwareRevision(fbb,
// hardwareRevisionOffset);
Expand Down

0 comments on commit e349440

Please sign in to comment.