You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by jo...@apache.org on 2017/03/18 05:25:38 UTC

zeppelin git commit: [ZEPPELIN-2282] NPE on NotebookServer.java when client send null ticket.

Repository: zeppelin
Updated Branches:
  refs/heads/master 2463731ed -> 1b5c3a3f3


[ZEPPELIN-2282] NPE on NotebookServer.java when client send null ticket.

### What is this PR for?
When client (zeppelin-web) send message with null ticket, NotebookServer does not handle and throw NPE.

### What type of PR is it?
Bug Fix

### Todos
* [x] - Null check

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2282

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <mo...@apache.org>

Closes #2153 from Leemoonsoo/ZEPPELIN-2282 and squashes the following commits:

1a05bed [Lee moon soo] prevent NPE


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/1b5c3a3f
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/1b5c3a3f
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/1b5c3a3f

Branch: refs/heads/master
Commit: 1b5c3a3f37c36f62a049cb3bdf2228d320e250d4
Parents: 2463731
Author: Lee moon soo <mo...@apache.org>
Authored: Fri Mar 17 14:44:14 2017 -0700
Committer: Jongyoul Lee <jo...@apache.org>
Committed: Sat Mar 18 14:25:18 2017 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/zeppelin/socket/NotebookServer.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1b5c3a3f/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
index 8670ed1..128d59d 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
@@ -193,7 +193,8 @@ public class NotebookServer extends WebSocketServlet
       }
 
       String ticket = TicketContainer.instance.getTicket(messagereceived.principal);
-      if (ticket != null && !ticket.equals(messagereceived.ticket)) {
+      if (ticket != null &&
+          (messagereceived.ticket == null || !ticket.equals(messagereceived.ticket))) {
         /* not to pollute logs, log instead of exception */
         if (StringUtils.isEmpty(messagereceived.ticket)) {
           LOG.debug("{} message: invalid ticket {} != {}", messagereceived.op,