Commits

David Larlet committed ae83f54

Check the existence of loadee before calling it

  • Participants
  • Parent commits fa57572

Comments (0)

Files changed (1)

         if not self.is_multipart() and ctype:
             loadee = self.loader_for_type(ctype)
             
-            try:
-                self.request.data = loadee(self.request.raw_post_data)
-                
-                # Reset both POST and PUT from request, as its
-                # misleading having their presence around.
-                self.request.POST = self.request.PUT = dict()
-            except (TypeError, ValueError):
-                raise MimerDataException
+            if loadee:
+                try:
+                    self.request.data = loadee(self.request.raw_post_data)
+                    
+                    # Reset both POST and PUT from request, as its
+                    # misleading having their presence around.
+                    self.request.POST = self.request.PUT = dict()
+                except (TypeError, ValueError):
+                    raise MimerDataException
 
         return self.request