Skip to content

Commit

Permalink
fix npe while decoding images from sharjahsat-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Oct 21, 2023
1 parent aa2f16b commit 6cdcbc7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,11 @@ jradio has lots of built-in satellite decoders. Some of them have non standard d
<td>56214</td>
<td>ru.r2cloud.jradio.sapling.SaplingGiganteumBeacon</td>
</tr>
<tr>
<td>ROSEYCUBESAT-1</td>
<td>56212</td>
<td>ru.r2cloud.jradio.roseycub.RoseyCubesatBeacon and images via ru.r2cloud.jradio.roseycub.RoseyPictureDecoder</td>
</tr>
</tbody>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public Sharjahsat1PictureDecoder(List<Sharjahsat1Beacon> beacons) {
Collections.sort(beacons, new Comparator<Sharjahsat1Beacon>() {
@Override
public int compare(Sharjahsat1Beacon o1, Sharjahsat1Beacon o2) {
return Long.compare(o2.getSharjahsat1Header().getPacketCounter(), o1.getSharjahsat1Header().getPacketCounter());
Sharjahsat1Header o2Header = o2.getSharjahsat1Header();
Sharjahsat1Header o1Header = o1.getSharjahsat1Header();
if (o2Header == null || o1Header == null) {
return 0;
}
return Long.compare(o2Header.getPacketCounter(), o1Header.getPacketCounter());
}
});
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/sharjahsat1_beacons.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
826C64AA9EA6E0826C60AA9EA66103F04553455250F6000000
826C64AA9EA6E0826C60AA9EA66103F04553455241F60E000000494A535455565758595A636465666768696A737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFC000110800F0014003012100021101031101FFDA000C03010002110311003F00EECF4A85EB03DB2B3D567A60446A16A4044D509C532461A88D32461A6D310CA6D0409494C42525218945020A5A02E2D2D050EA5CD218EA70A432415229A4512AD4AB4164CB532D22C9D0D594A451650D598CD228B919A9D8FEE8D219879A85CD6C7315D8D577340109A89A8111354469888DAA
826C64AA9EA6E0826C60AA9EA66103F04553455241F60F000000627282090A161718191A25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F0100030101010101010101010000000000000102030405060708090A0BFFC400B51100020102040403040705040400010277000102031104052131061241510761711322328108144291A1B1C109233352F0156272D10A162434E125F11718191A262728292A35363738393A434445464748
826C64AA9EA6E0826C60AA9EA66103F04553455241F610000000FFD8FFE000104A46494600010101000000000000FFDB0043000403030403030404030405040405060A07060606060C0909070A0F0D0F0F0E0D0E0E10121714101116110E0E141B141618191A1A1A10131C1E1C191E17191A19FFDB0043010405050605060C07070C19110E111919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919FFC4001F0000010501010101010100000000000000000102030405060708090A0BFFC400B5100002010303020403050504040000017D01020300041105122131410613516107227114328191A1082342B1C11552D1F02433

0 comments on commit 6cdcbc7

Please sign in to comment.