[ipp] Prevent NullPointerException if printer UUID is missing (#19915)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel
2025-12-29 23:37:46 +01:00
committed by GitHub
parent 403d8a8cd4
commit 3b11182b80
@@ -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, //