This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.7.x by this push:
     new eabb919  [CAMEL-16922] check string length before removing quotes 
(#6046)
eabb919 is described below

commit eabb91964fb97ff1c80457fc02f4b6d31d04addc
Author: fizzet <jen...@gmx.net>
AuthorDate: Fri Sep 3 17:41:30 2021 +0200

    [CAMEL-16922] check string length before removing quotes (#6046)
---
 core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java 
b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
index 3e9da32..ae076f9 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
@@ -145,6 +145,9 @@ public final class StringHelper {
         }
 
         String copy = s.trim();
+        if (copy.length() < 2) {
+            return s;
+        }
         if (copy.startsWith("'") && copy.endsWith("'")) {
             return copy.substring(1, copy.length() - 1);
         }

Reply via email to