{"action":"created","issue":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/123","labels_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/123/comments","events_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/123/events","html_url":"https://github.com/marshmallow-code/marshmallow/issues/123","id":53581546,"number":123,"title":"AttributeError exception when attempting to deserialize None","user":{"login":"RealSalmon","id":943086,"avatar_url":"https://avatars.githubusercontent.com/u/943086?v=3","gravatar_id":"","url":"https://api.github.com/users/RealSalmon","html_url":"https://github.com/RealSalmon","followers_url":"https://api.github.com/users/RealSalmon/followers","following_url":"https://api.github.com/users/RealSalmon/following{/other_user}","gists_url":"https://api.github.com/users/RealSalmon/gists{/gist_id}","starred_url":"https://api.github.com/users/RealSalmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealSalmon/subscriptions","organizations_url":"https://api.github.com/users/RealSalmon/orgs","repos_url":"https://api.github.com/users/RealSalmon/repos","events_url":"https://api.github.com/users/RealSalmon/events{/privacy}","received_events_url":"https://api.github.com/users/RealSalmon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-07T00:20:19Z","updated_at":"2015-01-07T14:31:27Z","closed_at":null,"body":"When attempting to deserialize None into a Schema, an AttributeError exception is thrown.\r\n\r\n```python\r\nfrom marshmallow import Schema\r\n\r\n\r\nclass MySchema(Schema):\r\n    class Meta:\r\n        fields = ('field1', 'field2')\r\n\r\n\r\ntest_dict = {'field1': 'value 1',\r\n             'field2': 'value 2',\r\n             'something': 'hey'}\r\n\r\nassert MySchema().load(test_dict).data == {k: test_dict[k] for k in test_dict\r\n                                           if k is not 'something'}\r\nassert MySchema().load({}).data == {}\r\nassert MySchema().load(None).data is None\r\n\r\n```\r\n\r\nThe final assert throws . . . \r\n\r\n```sh\r\nTraceback (most recent call last):\r\n  File \"test.py\", line 16, in <module>\r\n    assert MySchema().load(None).data is None\r\n  File \"/Users/bjones/Desktop/marshmallow/lib/python2.7/site-packages/marshmallow/schema.py\", line 490, in load\r\n    result, errors = self._do_load(data, many, postprocess=True)\r\n  File \"/Users/bjones/Desktop/marshmallow/lib/python2.7/site-packages/marshmallow/schema.py\", line 598, in _do_load\r\n    dict_class=self.dict_class\r\n  File \"/Users/bjones/Desktop/marshmallow/lib/python2.7/site-packages/marshmallow/fields.py\", line 277, in deserialize\r\n    raw_value = data.get(attr_name, missing)\r\nAttributeError: 'NoneType' object has no attribute 'get'\r\n```\r\n\r\nThis is with 1.2.0.\r\n\r\nObvously the test case is trivial to work around, but in practice I am trying to deserialize a much larger collection where some of the members may be None."},"comment":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/comments/69028782","html_url":"https://github.com/marshmallow-code/marshmallow/issues/123#issuecomment-69028782","issue_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/123","id":69028782,"user":{"login":"RealSalmon","id":943086,"avatar_url":"https://avatars.githubusercontent.com/u/943086?v=3","gravatar_id":"","url":"https://api.github.com/users/RealSalmon","html_url":"https://github.com/RealSalmon","followers_url":"https://api.github.com/users/RealSalmon/followers","following_url":"https://api.github.com/users/RealSalmon/following{/other_user}","gists_url":"https://api.github.com/users/RealSalmon/gists{/gist_id}","starred_url":"https://api.github.com/users/RealSalmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealSalmon/subscriptions","organizations_url":"https://api.github.com/users/RealSalmon/orgs","repos_url":"https://api.github.com/users/RealSalmon/repos","events_url":"https://api.github.com/users/RealSalmon/events{/privacy}","received_events_url":"https://api.github.com/users/RealSalmon/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T14:31:27Z","updated_at":"2015-01-07T14:31:27Z","body":"@sloria Thanks for your response.\r\n\r\nI like 2 the best, and see 3 as problematic.\r\n\r\nIn my present use case where this is causing problems, I am deserializing a list of dictionaries into a schema that has nested schemas. There as cases where the nested objects may indeed be None (e.g. an empty, previously serialized SQL Alchemy relationship to another model), and although I might be convinced otherwise, right now I would expect that to be faithfully represented.\r\n\r\ne.g. this json should be able to be deserialized without an execption and have the null, nested object accurately represented in the result.\r\n\r\n```javascript\r\n[\r\n   {\r\n      \"field1\": \"value1\",\r\n      \"nested1\": null\r\n   },\r\n   {\r\n      \"field1\": \"value2\",\r\n      \"nested1\": { \"otherfield\": \"somevalue\"}\r\n   }\r\n]\r\n```"}}