diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/satl/SatlMessage.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/satl/SatlMessage.java index eba9601068..37fcf60d86 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/satl/SatlMessage.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/satl/SatlMessage.java @@ -105,10 +105,11 @@ public abstract class SatlMessage { if (packetLength != packetLengthXOR) throw new InvalidPacketLengthsException(); if (version != VERSION) throw new IncompatibleSatlVersionException(); if (clazz == null) throw new InvalidSatlCommandException(); - SatlMessage message = null; + SatlMessage message; try { message = clazz.newInstance(); - } catch (Exception ignored) { + } catch (Exception exception) { + throw new IllegalArgumentException(); } message.parse(ByteBuf.from(payload)); message.setNonce(parsedNonce); @@ -135,10 +136,11 @@ public abstract class SatlMessage { if (packetLength != packetLengthXOR) throw new InvalidPacketLengthsException(); if (version != VERSION) throw new IncompatibleSatlVersionException(); if (clazz == null) throw new InvalidSatlCommandException(); - SatlMessage message = null; + SatlMessage message; try { message = clazz.newInstance(); - } catch (Exception ignored) { + } catch (Exception exception) { + throw new IllegalArgumentException(); } message.parse(ByteBuf.from(payload)); message.setNonce(Nonce.fromProductionalBytes(nonce));