Commits

Matthew Schinckel committed bb1dd50

Better handle no data

Comments (0)

Files changed (1)

rest_api/serializers/__init__.py

     return data
 
 def inspect_content(data):
-    if data[0] == "<":
-        return xml
-    if data[0] in ["[", "{"]:
-        return json
+    if data:
+        if data[0] == "<":
+            return xml
+        if data[0] in ["[", "{"]:
+            return json
     return None
     
 def deserialize(request):