Fix NoSuchElementException during initialization (#18578)

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2025-04-18 23:36:05 +02:00
committed by GitHub
parent 23e3e8427d
commit 6493e24c53
@@ -244,6 +244,13 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler<BlueGi
closeSerialPort(sp);
}
});
if (inputStream.isEmpty() || outputStream.isEmpty()) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
"Serial Error: Communication stream not available");
throw new RetryException(INITIALIZATION_INTERVAL_SEC, TimeUnit.SECONDS);
}
return sp;
} catch (PortInUseException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR,