This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
new 3740986fe [Bug] fix NPE in SQLCodeCheckInterceptor (#4062)
3740986fe is described below
commit 3740986fe849176100e8f0682dfcf60f510a7b6a
Author: GuoPhilipse <[email protected]>
AuthorDate: Wed Dec 28 17:20:22 2022 +0800
[Bug] fix NPE in SQLCodeCheckInterceptor (#4062)
* fix NPE
* fix variable name
---
.../entrance/interceptor/impl/SQLCodeCheckInterceptor.scala | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/interceptor/impl/SQLCodeCheckInterceptor.scala
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/interceptor/impl/SQLCodeCheckInterceptor.scala
index 0bc83de3a..3d82c91d2 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/interceptor/impl/SQLCodeCheckInterceptor.scala
+++
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/interceptor/impl/SQLCodeCheckInterceptor.scala
@@ -26,8 +26,15 @@ import org.apache.linkis.manager.label.utils.LabelUtil
class SQLCodeCheckInterceptor extends EntranceInterceptor {
override def apply(jobRequest: JobRequest, logAppender:
java.lang.StringBuilder): JobRequest = {
- val engineType = LabelUtil.getCodeType(jobRequest.getLabels)
- val languageType =
CodeAndRunTypeUtils.getLanguageTypeByCodeType(engineType.toLowerCase())
+ val codeType = {
+ val codeType = LabelUtil.getCodeType(jobRequest.getLabels)
+ if (null != codeType) {
+ codeType.toLowerCase()
+ } else {
+ ""
+ }
+ }
+ val languageType = CodeAndRunTypeUtils.getLanguageTypeByCodeType(codeType)
languageType match {
case CodeAndRunTypeUtils.LANGUAGE_TYPE_SQL =>
val sb: StringBuilder = new StringBuilder
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]