Skip to content

Commit 1cc2f8b

Browse files
author
Benoy Antony
committed
ZEPPELIN-2484 do a Null check before calling trim on paragraph's text
1 parent 6c4ccf3 commit 1cc2f8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,10 +1742,10 @@ private void runParagraph(NotebookSocket conn, HashSet<String> userAndRoles, Not
17421742
}
17431743

17441744
private void addNewParagraphIfLastParagraphIsExecuted(Note note, Paragraph p) {
1745-
// if it's the last paragraph and empty, let's add a new one
1745+
// if it's the last paragraph and not empty, let's add a new one
17461746
boolean isTheLastParagraph = note.isLastParagraph(p.getId());
1747-
if (!(p.getText().trim().equals(p.getMagic()) ||
1748-
Strings.isNullOrEmpty(p.getText())) &&
1747+
if (!(Strings.isNullOrEmpty(p.getText()) ||
1748+
p.getText().trim().equals(p.getMagic())) &&
17491749
isTheLastParagraph) {
17501750
Paragraph newPara = note.addNewParagraph(p.getAuthenticationInfo());
17511751
broadcastNewParagraph(note, newPara);

0 commit comments

Comments
 (0)