未验证 提交 d557f547 编写于 作者: K kezhenxu94 提交者: GitHub

Fix potential NPE in OAL string match and a bug when right-hand-side variable...

Fix potential NPE in OAL string match and a bug when right-hand-side variable includes double quotes (#8234)
上级 e7d6f890
......@@ -10,6 +10,7 @@ Release Notes.
#### OAP Server
* Fix potential NPE in OAL string match and a bug when right-hand-side variable includes double quotes.
#### UI
......
......@@ -25,12 +25,12 @@ import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterM
public class StringMatch {
public boolean match(String left, String right) {
if (left.startsWith("\"") && left.endsWith("\"")) {
if (left != null && left.startsWith("\"") && left.endsWith("\"")) {
left = left.substring(1, left.length() - 1);
}
if (right.startsWith("\"") && right.endsWith("\"")) {
right = left.substring(1, right.length() - 1);
if (right != null && right.startsWith("\"") && right.endsWith("\"")) {
right = right.substring(1, right.length() - 1);
}
return Objects.equals(left, right);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册