This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 1239d35e3 fix ShenyuTrie NPE (#4533)
1239d35e3 is described below
commit 1239d35e3b7590ed463df1ea6dbbd1561bacf4bf
Author: 常珂洁 <[email protected]>
AuthorDate: Wed Apr 5 16:16:33 2023 +0800
fix ShenyuTrie NPE (#4533)
* fix ShenyuTrie NPE
* correct checkstyle
---
.../src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java
b/shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java
index 1d8727449..8a04f0114 100644
---
a/shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java
+++
b/shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java
@@ -112,6 +112,9 @@ public class ShenyuTrie {
for (int i = 0; i < pathParts.length; i++) {
boolean endOfPath = isMatchAllOrWildcard(pathParts[i]) &&
judgeEqual(i, pathParts.length - 1);
node = putNode0(pathParts[i], node, matchMode, endOfPath);
+ if (Objects.isNull(node)) {
+ return;
+ }
}
// after insert node, set full path and end of path
node.setFullPath(uriPath);