You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/10/31 11:47:33 UTC

[incubator-linkis] branch dev-1.3.1 updated: local rpc getResponse NPE (#3747)

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

casion pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new 22afe4179 local rpc getResponse NPE (#3747)
22afe4179 is described below

commit 22afe4179d17947601cd528a707b911f23631b2b
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Mon Oct 31 19:47:26 2022 +0800

    local rpc getResponse NPE (#3747)
---
 .../org/apache/linkis/server/restful/SpringRestfulCatchAOP.scala  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/restful/SpringRestfulCatchAOP.scala b/linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/restful/SpringRestfulCatchAOP.scala
index 3c03417b1..c02527af7 100644
--- a/linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/restful/SpringRestfulCatchAOP.scala
+++ b/linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/restful/SpringRestfulCatchAOP.scala
@@ -46,7 +46,10 @@ class SpringRestfulCatchAOP extends Logging {
       }
     }
     // convert http status code
-    getCurrentHttpResponse.setStatus(Message.messageToHttpStatus(resp))
+    val response = getCurrentHttpResponse
+    if (response != null) {
+      getCurrentHttpResponse.setStatus(Message.messageToHttpStatus(resp))
+    }
     resp
   }
 
@@ -54,8 +57,7 @@ class SpringRestfulCatchAOP extends Logging {
     val requestAttributes = RequestContextHolder.getRequestAttributes
     requestAttributes match {
       case attributes: ServletRequestAttributes =>
-        val response = attributes.getResponse
-        response
+        attributes.getResponse
       case _ => null
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org