From 8b39f49a8fa169c98a542c05e033aeaec80afe74 Mon Sep 17 00:00:00 2001 From: Marina Sahakyan Date: Tue, 27 Sep 2022 17:28:54 +0200 Subject: [PATCH] dcache: NPE on removal via WebDAV and token Motivation NPE was accuring while sending kafka messages, when JwtJtiPrincipal was used. Modification fix the NPE error when toString was called Target: master, 8.2 8.1 8.0 7.2 7.1 7.0 Require-book: no Require-notes: yes Acked-by: Paul Millar --- .../src/main/java/org/dcache/auth/OpScopedPrincipal.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/common/src/main/java/org/dcache/auth/OpScopedPrincipal.java b/modules/common/src/main/java/org/dcache/auth/OpScopedPrincipal.java index a4a1050012c..aa22341aa2f 100644 --- a/modules/common/src/main/java/org/dcache/auth/OpScopedPrincipal.java +++ b/modules/common/src/main/java/org/dcache/auth/OpScopedPrincipal.java @@ -49,6 +49,9 @@ public boolean equals(Object other) { return true; } + if (other == null) { + return false; + } return this.getClass().equals(other.getClass()) && ((Principal) other).getName().equals(name); }