Synchronization thread dies (fix included)
Brought to you by:
baumgarr
It seems tempNotebook.getPublishing() can return null when tempNotebook.isPublished() == true !
This fixes the exception I have seen from time time and always had to do a fresh (empty directory) resync to recover. [I think the problem is caused in a shared notebook that a Winduh's client changed. Best guess might be related to them renaming/changing a notebook...]
diff --git a/src/cx/fbn/nevernote/sql/NotebookTable.java b/src/cx/fbn/nevernote/sql/NotebookTable.java index 0dd10e0..6c050b6 100644 --- a/src/cx/fbn/nevernote/sql/NotebookTable.java +++ b/src/cx/fbn/nevernote/sql/NotebookTable.java @@ -238,8 +238,9 @@ public class NotebookTable { query.bindValue(":published", tempNotebook.isPublished()); query.bindValue(":isDirty", isDirty); - if (tempNotebook.isPublished()) { - query.bindValue(":uri", tempNotebook.getPublishing().getUri()); + Publishing pub = tempNotebook.getPublishing();^M + if (tempNotebook.isPublished() && pub != null) {^M + query.bindValue(":uri", pub.getUri());^M query.bindValue(":order", tempNotebook.getPublishing().getOrder().getValue()); query.bindValue(":ascending", tempNotebook.getPublishing().isAscending()); query.bindValue(":desc", tempNotebook.getPublishing().getPublicDescription());
I am attaching the patch as well given markdown seems to reformat it.