mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[ipp] Prevent NullPointerException if printer UUID is missing (#19915)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
+7
@@ -95,6 +95,13 @@ public class IppPrinterDiscoveryParticipant implements MDNSDiscoveryParticipant
|
||||
int port = service.getPort();
|
||||
String uuid = service.getPropertyString("UUID");
|
||||
|
||||
if (uuid == null) {
|
||||
logger.debug(
|
||||
"Discovered ipp printer with missing UUID, ignoring: uid: {}, inetAddress: {}, port: {}, rp: {}",
|
||||
uid, inetAddress, port, rp);
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, Object> properties = Map.of( //
|
||||
PRINTER_PARAMETER_URL, "http://" + inetAddress + ":" + port + "/" + rp, //
|
||||
PRINTER_PARAMETER_NAME, label, //
|
||||
|
||||
Reference in New Issue
Block a user