From 27944578458b9014241f6c7178e1731020d6a9f8 Mon Sep 17 00:00:00 2001 From: Dmitry Kryukov Date: Tue, 23 Apr 2024 21:32:15 +0300 Subject: [PATCH] CAMEL-20713 Added type check into equals() --- .../main/java/org/apache/camel/component/plc4x/TagData.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/TagData.java b/components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/TagData.java index a191d1c3406d3..a3ff2dcf0acdc 100644 --- a/components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/TagData.java +++ b/components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/TagData.java @@ -145,6 +145,9 @@ public String toString() { @Override public boolean equals(Object tag) { + if (!(tag instanceof TagData)) { + return false; + } return value != null ? ((TagData) tag).getValue().equals(value) && ((TagData) tag).getTagName().equals(tagName)