Initialize contentSha256 in the constructor.
diff --git a/js/ndnProtocol/components/ndnProtocolService.js b/js/ndnProtocol/components/ndnProtocolService.js
index a6f7f01..2f27973 100644
--- a/js/ndnProtocol/components/ndnProtocolService.js
+++ b/js/ndnProtocol/components/ndnProtocolService.js
@@ -137,7 +137,7 @@
     

     this.firstReceivedSegmentNumber = null;

     this.firstReceivedContentObject = null;

-    this.contentSha256 = null;

+    this.contentSha256 = new Sha256();

 };

 

 ContentClosure.prototype.upcall = function(kind, upcallInfo) {

@@ -194,8 +194,6 @@
         var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);

         this.contentListener.onStart(contentTypeEtc.contentType, contentTypeEtc.contentCharset, 

             ioService.newURI(contentUriSpec, this.uriOriginCharset, null));

-            

-        this.contentSha256 = new Sha256();

     }

 

     this.contentListener.onReceivedContent(DataUtils.toString(contentObject.content));