src/js/data.js
branchpopcorn-port
changeset 174 7a6450d251fc
parent 128 f3fec80dd31c
child 184 a4be54204b71
--- a/src/js/data.js	Thu Nov 03 13:07:33 2011 +0100
+++ b/src/js/data.js	Thu Nov 03 13:08:32 2011 +0100
@@ -46,6 +46,11 @@
   /* This function returns serializer set-up with the correct
      configuration - takes a metadata struct describing the metadata source
   */
+  
+  if (metadataOptions === undefined)
+    /* return an empty serializer */
+    return IriSP.Serializer("", "");
+            
   switch(metadataOptions.type) {
     case "json":
       return new IriSP.JSONSerializer(this._dataloader, metadataOptions.src);
@@ -54,8 +59,12 @@
     case "dummy": /* only used for unit testing - not defined in production */
       return new IriSP.MockSerializer(this._dataloader, metadataOptions.src);
       break;
+    
+    case "empty":
+      return new IriSP.Serializer("", "empty");
+      break;
       
-    default:
+    default:      
       return undefined;
   }
 };