ConfX created ZEPPELIN-5941: ------------------------------- Summary: Missing null check in Notebook Key: ZEPPELIN-5941 URL: https://issues.apache.org/jira/browse/ZEPPELIN-5941 Project: Zeppelin Issue Type: Bug Reporter: ConfX Attachments: reproduce.sh
h2. What happened: Got NullPointerException when initializing a Notebook. h2. Where's the bug: At the end of the constructor of {{Notebook}} a rebuild takes place: {noformat} if (conf.isIndexRebuild()) { noteSearchService.startRebuildIndex(getNoteStream()); }{noformat} The problem with this is that if {{noteSearchService}} is null, the code would throw an NPE out of nowhere with no message. h2. StackTrace: {noformat} java.lang.NullPointerException, at org.apache.zeppelin.notebook.Notebook.<init>(Notebook.java:112), at org.apache.zeppelin.notebook.Notebook.<init>(Notebook.java:165), at org.apache.zeppelin.notebook.NotebookTest.testRevisionSupported(NotebookTest.java:124),{noformat} h2. How to reproduce: (1) Set {{zeppelin.search.index.rebuild }} to {{true }} (2) Run test: {{org.apache.zeppelin.notebook.NotebookTest#testRevisionSupported }} For an easy reproduction, run the reproduce.sh in the attachment. We are happy to provide a patch if this issue is confirmed. {{}} -- This message was sent by Atlassian Jira (v8.20.10#820010)