In toHex, if argument is null, return "".
diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp
index b4a1bd8..3a00593 100644
--- a/ndn-cpp/common.cpp
+++ b/ndn-cpp/common.cpp
@@ -12,6 +12,9 @@
 
 string toHex(const vector<unsigned char>& array) 
 {
+  if (!&array)
+    return "";
+  
   ostringstream result;
   result.flags(ios::hex | ios::uppercase);
   for (unsigned int i = 0; i < array.size(); ++i) {