Fixes #95, Notes.add() fails when sourceitem is null
This commit is contained in:
parent
9a7d619122
commit
2dece39ad3
|
@ -1192,9 +1192,11 @@ Scholar.Notes = new function(){
|
||||||
Scholar.DB.query(sql, bindParams);
|
Scholar.DB.query(sql, bindParams);
|
||||||
Scholar.DB.commitTransaction();
|
Scholar.DB.commitTransaction();
|
||||||
|
|
||||||
|
if (sourceItemID){
|
||||||
sourceItem.incrementNoteCount();
|
sourceItem.incrementNoteCount();
|
||||||
|
|
||||||
Scholar.Notifier.trigger('modify', 'item', sourceItemID);
|
Scholar.Notifier.trigger('modify', 'item', sourceItemID);
|
||||||
|
}
|
||||||
|
|
||||||
Scholar.Notifier.trigger('add', 'item', note.getID());
|
Scholar.Notifier.trigger('add', 'item', note.getID());
|
||||||
|
|
||||||
return note.getID();
|
return note.getID();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user