liuxunorg commented on a change in pull request #3276: [ZEPPELIN-3928] Fix bugs
AngularBind operation NullPointerException
URL: https://github.com/apache/zeppelin/pull/3276#discussion_r244526697
##########
File path:
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
##########
@@ -1708,20 +1708,16 @@ public void onAdd(String interpreterGroupId,
AngularObject object) {
@Override
public void onUpdate(String interpreterGroupId, AngularObject object) {
- if (getNotebook() == null) {
+ if (getNotebook() == null || object.getNoteId() == null) {
return;
}
- List<Note> notes = getNotebook().getAllNotes();
- for (Note note : notes) {
- if (object.getNoteId() != null &&
!note.getId().equals(object.getNoteId())) {
- continue;
- }
-
+ Note note = getNotebook().getNote(object.getNoteId());
Review comment:
Judge `object.getNoteId() == null` Is to prevent `Note note =
getNotebook().getNote(object.getNoteId());` exception
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services