OSDN Git Service

Check for possible null pointer assignment when preparing resource
authorRandy Baumgarte <randy@fbn.cx>
Sat, 13 Oct 2012 11:09:42 +0000 (07:09 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sat, 13 Oct 2012 11:22:58 +0000 (07:22 -0400)
src/cx/fbn/nevernote/threads/ThumbnailRunner.java

index a8c7d8d..61fbfd2 100644 (file)
@@ -220,8 +220,10 @@ public class ThumbnailRunner extends QObject implements Runnable {
                js.replace("<!DOCTYPE en-note SYSTEM 'http://xml.evernote.com/pub/enml2.dtd'>", "");\r
                js.replace("<?xml version='1.0' encoding='UTF-8'?>", "");\r
                int zoom = 1;\r
-               String content = currentNote.getContent();\r
-               zoom = Global.calculateThumbnailZoom(content);\r
+               if (currentNote != null && currentNote.getContent() != null) {\r
+                       String content = currentNote.getContent();\r
+                       zoom = Global.calculateThumbnailZoom(content);\r
+               }\r
                logger.log(logger.HIGH, "Thumbnail file ready");\r
                noteSignal.thumbnailPageReady.emit(guid, js, zoom);\r
        }\r