[fix] fix NPE in SysVariableDesc::equal (#7766)

This commit is contained in:
GoGoWen
2022-01-16 10:42:24 +08:00
committed by GitHub
parent 36d6d236ad
commit 88a3d08fee

View File

@ -32,6 +32,8 @@ import org.apache.doris.thrift.TStringLiteral;
import com.google.common.base.Strings;
import java.util.Objects;
// System variable
// Converted to StringLiteral in analyze, if this variable is not exist, throw AnalysisException.
public class SysVariableDesc extends Expr {
@ -189,6 +191,7 @@ public class SysVariableDesc extends Expr {
if (!setType.equals(((SysVariableDesc) obj).getSetType())) {
return false;
}
return literalExpr.equals(((SysVariableDesc) obj).getLiteralExpr());
return Objects.equals(literalExpr, ((SysVariableDesc) obj).getLiteralExpr());
}
}