From 53340c6313011d32fe33300d762caf60fbd4ffc7 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Wed, 24 Apr 2024 11:47:14 -0300 Subject: [PATCH] Avoid NPE in PgsqlGwcInitializer, TileLayerEvent.getOldName() may be null --- .../cloud/autoconfigure/gwc/backend/PgsqlGwcInitializer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/backend/PgsqlGwcInitializer.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/backend/PgsqlGwcInitializer.java index 96b109116..c7b0b3208 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/backend/PgsqlGwcInitializer.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/backend/PgsqlGwcInitializer.java @@ -96,7 +96,9 @@ void onTileLayerEvent(TileLayerEvent event) { cache.removeUncachedLayer(event.getName()); break; case MODIFIED: - if (!Objects.equal(event.getOldName(), event.getName())) { + if (event.getOldName() != null + && !Objects.equal( + event.getOldName(), event.getName())) { log.info( "TileLayer {} renamed to {}, notifying in-memory CacheProvider", event.getOldName(),