diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index aff06634..d30adf1c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
 Changelog
 ---------
 
+2.15.5
++++++++++++++++++++
+
+Bug fixes:
+
+- Handle empty SQAlchemy lazy lists gracefully when dumping (:issue:`948`).
+  Thanks :user:`vke-code` for the catch and :user:`YuriHeupa` for the patch.
+
 2.15.4 (2018-08-04)
 +++++++++++++++++++
 
diff --git a/marshmallow/schema.py b/marshmallow/schema.py
index 90e84bff..1d2a71db 100644
--- a/marshmallow/schema.py
+++ b/marshmallow/schema.py
@@ -819,7 +819,7 @@ class BaseSchema(base.SchemaABC):
                 else:
                     obj_prototype = next(iter(obj))
             except (StopIteration, IndexError):  # Nothing to serialize
-                return self.declared_fields
+                return dict((k, v) for k, v in self.declared_fields.items() if k in field_names)
             obj = obj_prototype
         ret = self.dict_class()
         for key in field_names:

No attribute '_add_to_schema' when dumping Schema and Nested Field is None
Hi Marshmallow Code!

I have recently discovered and began implementing your code for my own projects and I must say you have changed how I work with databases forever! 

I have been running up against a wall with this issue however, and decided to reach out to the pros! It could be that I am missing something simple.

For context, I am storing hosts in a database. 'Hosts' have a one-to-many relationship with 'Ports'. 

I have developed a HostSchema and PortSchema using ModelSchema from marshmallow-sqlalchemy. This works BEAUTIFULLY, except when a host does not have any ports associated with it. 

Attached below is example code which demonstrates the expected behavior as well as the error. Please excuse me if this isn't an actual bug and just user error, although some insight would be very much appreciated.

### Truncated Pip Freeze
- Flask==1.0.2
- flask-marshmallow==0.9.0
- Flask-SQLAlchemy==2.3.2
- marshmallow==2.15.4
- marshmallow-sqlalchemy==0.14.1
- SQLAlchemy==1.2.11

### Minimal Example
```py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow

from marshmallow import fields, post_dump, pre_dump
import json

app = Flask(__name__)
db = SQLAlchemy(app)
ma = Marshmallow(app)

class Host(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    ip = db.Column(db.String(16), index=True, unique=True, nullable=False)

    ports = db.relationship('Port', backref='host', lazy='dynamic')


class Port(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    host_id = db.Column(db.Integer, db.ForeignKey('host.id'), index=True)
    port = db.Column(db.Integer)
    transport = db.Column(db.String(8))
    service = db.Column(db.String(16))


class PortSchema(ma.ModelSchema):
    class Meta:
        model = Port
        exclude = ('id' , 'host')
        sqla_session = db.Session

class HostSchema(ma.ModelSchema):
    ports = fields.Nested(PortSchema, many=True)
    class Meta:
        model = Host
        sqla_session = db.Session
```
### Behavior when 'ports' is defined in 'host' object.
This works as expected.

```py
host = Host(ip='127.0.0.1')
port = Port(port=80, transport='tcp', service='http')
host.ports.append(port)

result = HostSchema().dump(host)

print json.dumps(result.data, indent=2)


# {
#   "ip": "127.0.0.1",
#   "ports": [
#     {
#       "transport": "tcp",
#       "service": "http",
#       "port": 80
#     }
#   ],
#   "id": null
# }
```

### Unexpected behavior when 'ports' is undefined in 'host' object.
From what I've gathered from the documentation the default behavior is to skip any fields which are missing during serialization. I have also tried using `missing` and `default`, but if I understand correctly these only apply for deserialization. 

```py
host = Host(ip='127.0.0.1')
result = HostSchema().dump(host)
```

### Expected Behavior
```py
{
  "ip": "127.0.0.1",
  "ports": {},
  "id": null
}
```
### Actual result:
```py
Traceback (most recent call last):
  File "scratch/missing-field-nested-bug.py", line 72, in <module>
    result = HostSchema().dump(host)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/schema.py", line 509, in dump
    **kwargs
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/marshalling.py", line 138, in serialize
    index=(index if index_errors else None)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/marshalling.py", line 62, in call_and_store
    value = getter_func(data)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/marshalling.py", line 132, in <lambda>
    getter = lambda d: field_obj.serialize(attr_name, d, accessor=accessor)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/fields.py", line 252, in serialize
    return self._serialize(value, attr, obj)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/fields.py", line 447, in _serialize
    schema._update_fields(obj=nested_obj, many=self.many)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/schema.py", line 767, in _update_fields
    self.__set_field_attrs(ret)
  File "/Users/kai/.virtualenvs/SPEZZI/lib/python2.7/site-packages/marshmallow/schema.py", line 788, in __set_field_attrs
    field_obj._add_to_schema(field_name, self)
AttributeError: 'NoneType' object has no attribute '_add_to_schema'
```


Thank you all for any help or insights you can offer! Please let me know if further clarification is required.
diff --git a/tests/test_schema.py b/tests/test_schema.py
index 5a6fd959..7f0e8cb8 100755
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -694,6 +694,36 @@ def test_error_raised_if_additional_option_is_not_list():
                 additional = 'email'
 
 
+def test_nested_custom_set_in_exclude_reusing_schema():
+
+    class CustomSet(object):
+        # This custom set is to allow the obj check in BaseSchema.__filter_fields
+        # to pass, since it'll be a valid instance, and this class overrides
+        # getitem method to allow the hasattr check to pass too, which will try
+        # to access the first obj index and will simulate a IndexError throwing.
+        # e.g. SqlAlchemy.Query is a valid use case for this "obj".
+
+        def __getitem__(self, item):
+            return [][item]
+
+    class ChildSchema(Schema):
+        foo = fields.Field(required=True)
+        bar = fields.Field()
+
+        class Meta:
+            only = ('bar', )
+
+    class ParentSchema(Schema):
+        child = fields.Nested(ChildSchema, many=True, exclude=('foo',))
+
+    sch = ParentSchema(strict=True)
+    obj = dict(child=CustomSet())
+    sch.dumps(obj)
+    data = dict(child=[{'bar': 1}])
+    result = sch.load(data, partial=True)
+    assert not result.errors
+
+
 def test_nested_only():
     class ChildSchema(Schema):
         foo = fields.Field()

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pytest
apt-get update apt-get install -y gcc
3.9
dev-requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cachetools==5.5.2
chardet==5.2.0
colorama==0.4.6
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.2
execnet==2.1.1
filelock==3.18.0
flake8==2.4.1
iniconfig==2.1.0
invoke==0.21.0
-e git+https://github.com/marshmallow-code/marshmallow.git@b0ebaf6f13f9833ccc6b19900208b211597480e9#egg=marshmallow
mccabe==0.3.1
packaging==24.2
pep8==1.7.1
platformdirs==4.3.7
pluggy==1.5.0
py==1.11.0
pyflakes==0.8.1
pyproject-api==1.9.0
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
pytz==2025.2
simplejson==3.20.1
six==1.17.0
tomli==2.2.1
tox==4.25.0
typing_extensions==4.13.0
virtualenv==20.29.3

name: marshmallow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cachetools==5.5.2
      - chardet==5.2.0
      - colorama==0.4.6
      - coverage==7.8.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - filelock==3.18.0
      - flake8==2.4.1
      - iniconfig==2.1.0
      - invoke==0.21.0
      - mccabe==0.3.1
      - packaging==24.2
      - pep8==1.7.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - py==1.11.0
      - pyflakes==0.8.1
      - pyproject-api==1.9.0
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - simplejson==3.20.1
      - six==1.17.0
      - tomli==2.2.1
      - tox==4.25.0
      - typing-extensions==4.13.0
      - virtualenv==20.29.3
prefix: /opt/conda/envs/marshmallow

tests/test_schema.py::test_nested_custom_set_in_exclude_reusing_schema
tests/test_schema.py::test_serializing_basic_object[UserSchema] tests/test_schema.py::test_serializing_basic_object[UserMetaSchema] tests/test_schema.py::test_serializer_dump tests/test_schema.py::test_dump_returns_dict_of_errors tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserSchema] tests/test_schema.py::test_dump_with_strict_mode_raises_error[UserMetaSchema] tests/test_schema.py::test_dump_resets_errors tests/test_schema.py::test_load_resets_errors tests/test_schema.py::test_dump_resets_error_fields tests/test_schema.py::test_load_resets_error_fields tests/test_schema.py::test_load_resets_error_kwargs tests/test_schema.py::test_errored_fields_do_not_appear_in_output tests/test_schema.py::test_load_many_stores_error_indices tests/test_schema.py::test_dump_many tests/test_schema.py::test_multiple_errors_can_be_stored_for_a_given_index tests/test_schema.py::test_dump_many_stores_error_indices tests/test_schema.py::test_dump_many_doesnt_stores_error_indices_when_index_errors_is_false tests/test_schema.py::test_dump_returns_a_marshalresult tests/test_schema.py::test_dumps_returns_a_marshalresult tests/test_schema.py::test_dumping_single_object_with_collection_schema tests/test_schema.py::test_loading_single_object_with_collection_schema tests/test_schema.py::test_dumps_many tests/test_schema.py::test_load_returns_an_unmarshalresult tests/test_schema.py::test_load_many tests/test_schema.py::test_loads_returns_an_unmarshalresult tests/test_schema.py::test_loads_many tests/test_schema.py::test_loads_deserializes_from_json tests/test_schema.py::test_serializing_none tests/test_schema.py::test_default_many_symmetry tests/test_schema.py::test_on_bind_field_hook tests/test_schema.py::test_nested_on_bind_field_hook tests/test_schema.py::TestValidate::test_validate_returns_errors_dict tests/test_schema.py::TestValidate::test_validate_many tests/test_schema.py::TestValidate::test_validate_many_doesnt_store_index_if_index_errors_option_is_false tests/test_schema.py::TestValidate::test_validate_strict tests/test_schema.py::TestValidate::test_validate_required tests/test_schema.py::test_fields_are_not_copies[UserSchema] tests/test_schema.py::test_fields_are_not_copies[UserMetaSchema] tests/test_schema.py::test_dumps_returns_json tests/test_schema.py::test_naive_datetime_field tests/test_schema.py::test_datetime_formatted_field tests/test_schema.py::test_datetime_iso_field tests/test_schema.py::test_tz_datetime_field tests/test_schema.py::test_local_datetime_field tests/test_schema.py::test_class_variable tests/test_schema.py::test_serialize_many[UserSchema] tests/test_schema.py::test_serialize_many[UserMetaSchema] tests/test_schema.py::test_inheriting_schema tests/test_schema.py::test_custom_field tests/test_schema.py::test_url_field tests/test_schema.py::test_relative_url_field tests/test_schema.py::test_stores_invalid_url_error[UserSchema] tests/test_schema.py::test_stores_invalid_url_error[UserMetaSchema] tests/test_schema.py::test_email_field[UserSchema] tests/test_schema.py::test_email_field[UserMetaSchema] tests/test_schema.py::test_stored_invalid_email tests/test_schema.py::test_integer_field tests/test_schema.py::test_as_string tests/test_schema.py::test_extra tests/test_schema.py::test_extra_many tests/test_schema.py::test_method_field[UserSchema] tests/test_schema.py::test_method_field[UserMetaSchema] tests/test_schema.py::test_function_field tests/test_schema.py::test_prefix[UserSchema] tests/test_schema.py::test_prefix[UserMetaSchema] tests/test_schema.py::test_fields_must_be_declared_as_instances tests/test_schema.py::test_serializing_generator[UserSchema] tests/test_schema.py::test_serializing_generator[UserMetaSchema] tests/test_schema.py::test_serializing_empty_list_returns_empty_list tests/test_schema.py::test_serializing_dict tests/test_schema.py::test_serializing_dict_with_meta_fields tests/test_schema.py::test_exclude_in_init[UserSchema] tests/test_schema.py::test_exclude_in_init[UserMetaSchema] tests/test_schema.py::test_only_in_init[UserSchema] tests/test_schema.py::test_only_in_init[UserMetaSchema] tests/test_schema.py::test_invalid_only_param tests/test_schema.py::test_can_serialize_uuid tests/test_schema.py::test_can_serialize_time tests/test_schema.py::test_invalid_time tests/test_schema.py::test_invalid_date tests/test_schema.py::test_invalid_email tests/test_schema.py::test_invalid_url tests/test_schema.py::test_invalid_dict_but_okay tests/test_schema.py::test_custom_json tests/test_schema.py::test_custom_error_message tests/test_schema.py::test_load_errors_with_many tests/test_schema.py::test_error_raised_if_fields_option_is_not_list tests/test_schema.py::test_error_raised_if_additional_option_is_not_list tests/test_schema.py::test_nested_only tests/test_schema.py::test_nested_only_inheritance tests/test_schema.py::test_nested_only_empty_inheritance tests/test_schema.py::test_nested_exclude tests/test_schema.py::test_nested_exclude_inheritance tests/test_schema.py::test_nested_only_and_exclude tests/test_schema.py::test_nested_only_then_exclude_inheritance tests/test_schema.py::test_nested_exclude_then_only_inheritance tests/test_schema.py::test_nested_exclude_and_only_inheritance tests/test_schema.py::test_meta_nested_exclude tests/test_schema.py::test_nested_custom_set_not_implementing_getitem tests/test_schema.py::test_deeply_nested_only_and_exclude tests/test_schema.py::TestDeeplyNestedLoadOnly::test_load_only tests/test_schema.py::TestDeeplyNestedLoadOnly::test_dump_only tests/test_schema.py::TestDeeplyNestedListLoadOnly::test_load_only tests/test_schema.py::TestDeeplyNestedListLoadOnly::test_dump_only tests/test_schema.py::test_nested_constructor_only_and_exclude tests/test_schema.py::test_only_and_exclude tests/test_schema.py::test_exclude_invalid_attribute tests/test_schema.py::test_only_with_invalid_attribute tests/test_schema.py::test_only_bounded_by_fields tests/test_schema.py::test_only_empty tests/test_schema.py::test_nested_with_sets tests/test_schema.py::test_meta_serializer_fields tests/test_schema.py::test_meta_fields_mapping tests/test_schema.py::test_meta_field_not_on_obj_raises_attribute_error tests/test_schema.py::test_exclude_fields tests/test_schema.py::test_fields_option_must_be_list_or_tuple tests/test_schema.py::test_exclude_option_must_be_list_or_tuple tests/test_schema.py::test_dateformat_option tests/test_schema.py::test_default_dateformat tests/test_schema.py::test_inherit_meta tests/test_schema.py::test_inherit_meta_override tests/test_schema.py::test_additional tests/test_schema.py::test_cant_set_both_additional_and_fields tests/test_schema.py::test_serializing_none_meta tests/test_schema.py::TestErrorHandler::test_error_handler_decorator_is_deprecated tests/test_schema.py::TestErrorHandler::test_dump_with_custom_error_handler tests/test_schema.py::TestErrorHandler::test_dump_with_custom_error_handler_and_strict tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler tests/test_schema.py::TestErrorHandler::test_load_with_custom_error_handler_and_partially_valid_data tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_decorator tests/test_schema.py::TestErrorHandler::test_custom_error_handler_with_validates_schema_decorator tests/test_schema.py::TestErrorHandler::test_validate_with_custom_error_handler tests/test_schema.py::TestFieldValidation::test_errors_are_cleared_after_loading_collection tests/test_schema.py::TestFieldValidation::test_raises_error_with_list tests/test_schema.py::TestFieldValidation::test_raises_error_with_dict tests/test_schema.py::TestFieldValidation::test_ignored_if_not_in_only tests/test_schema.py::test_schema_repr tests/test_schema.py::TestNestedSchema::test_flat_nested tests/test_schema.py::TestNestedSchema::test_flat_nested_with_dump_to tests/test_schema.py::TestNestedSchema::test_nested_many_with_missing_attribute tests/test_schema.py::TestNestedSchema::test_nested_with_attribute_none tests/test_schema.py::TestNestedSchema::test_flat_nested2 tests/test_schema.py::TestNestedSchema::test_nested_field_does_not_validate_required tests/test_schema.py::TestNestedSchema::test_nested_required_errors_with_load_from tests/test_schema.py::TestNestedSchema::test_nested_none tests/test_schema.py::TestNestedSchema::test_nested tests/test_schema.py::TestNestedSchema::test_nested_many_fields tests/test_schema.py::TestNestedSchema::test_nested_meta_many tests/test_schema.py::TestNestedSchema::test_nested_only tests/test_schema.py::TestNestedSchema::test_exclude tests/test_schema.py::TestNestedSchema::test_list_field tests/test_schema.py::TestNestedSchema::test_nested_load_many tests/test_schema.py::TestNestedSchema::test_nested_errors tests/test_schema.py::TestNestedSchema::test_nested_strict tests/test_schema.py::TestNestedSchema::test_nested_dump_errors tests/test_schema.py::TestNestedSchema::test_nested_dump_strict tests/test_schema.py::TestNestedSchema::test_nested_method_field tests/test_schema.py::TestNestedSchema::test_nested_function_field tests/test_schema.py::TestNestedSchema::test_nested_prefixed_field tests/test_schema.py::TestNestedSchema::test_nested_prefixed_many_field tests/test_schema.py::TestNestedSchema::test_invalid_float_field tests/test_schema.py::TestNestedSchema::test_serializer_meta_with_nested_fields tests/test_schema.py::TestNestedSchema::test_serializer_with_nested_meta_fields tests/test_schema.py::TestNestedSchema::test_nested_fields_must_be_passed_a_serializer tests/test_schema.py::TestNestedSchema::test_invalid_type_passed_to_nested_field tests/test_schema.py::TestNestedSchema::test_all_errors_on_many_nested_field_with_validates_decorator tests/test_schema.py::TestNestedSchema::test_missing_required_nested_field tests/test_schema.py::TestSelfReference::test_nesting_schema_within_itself tests/test_schema.py::TestSelfReference::test_nesting_schema_by_passing_class_name tests/test_schema.py::TestSelfReference::test_nesting_within_itself_meta tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field tests/test_schema.py::TestSelfReference::test_recursive_missing_required_field_one_level_in tests/test_schema.py::TestSelfReference::test_nested_self_with_only_param tests/test_schema.py::TestSelfReference::test_multiple_nested_self_fields tests/test_schema.py::TestSelfReference::test_nested_many tests/test_schema.py::test_serialization_with_required_field tests/test_schema.py::test_deserialization_with_required_field tests/test_schema.py::test_deserialization_with_required_field_and_custom_validator tests/test_schema.py::TestContext::test_context_method tests/test_schema.py::TestContext::test_context_method_function tests/test_schema.py::TestContext::test_function_field_raises_error_when_context_not_available tests/test_schema.py::TestContext::test_fields_context tests/test_schema.py::TestContext::test_nested_fields_inherit_context tests/test_schema.py::TestContext::test_nested_list_fields_inherit_context tests/test_schema.py::test_serializer_can_specify_nested_object_as_attribute tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_schema_subclass tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_non_schema_subclass tests/test_schema.py::TestFieldInheritance::test_inheritance_follows_mro tests/test_schema.py::TestAccessor::test_accessor_decorator_is_deprecated tests/test_schema.py::TestAccessor::test_accessor_is_used tests/test_schema.py::TestAccessor::test_accessor_with_many tests/test_schema.py::TestRequiredFields::test_required_string_field_missing tests/test_schema.py::TestRequiredFields::test_required_string_field_failure tests/test_schema.py::TestRequiredFields::test_allow_none_param tests/test_schema.py::TestRequiredFields::test_allow_none_custom_message tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_dump_output tests/test_schema.py::TestDefaults::test_none_is_serialized_to_none tests/test_schema.py::TestDefaults::test_default_and_value_missing tests/test_schema.py::TestDefaults::test_loading_none tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_load_output tests/test_schema.py::TestLoadOnly::test_load_only tests/test_schema.py::TestLoadOnly::test_dump_only tests/test_schema.py::TestStrictDefault::test_default tests/test_schema.py::TestStrictDefault::test_meta_true tests/test_schema.py::TestStrictDefault::test_meta_false tests/test_schema.py::TestStrictDefault::test_default_init_true tests/test_schema.py::TestStrictDefault::test_default_init_false tests/test_schema.py::TestStrictDefault::test_meta_true_init_true tests/test_schema.py::TestStrictDefault::test_meta_true_init_false tests/test_schema.py::TestStrictDefault::test_meta_false_init_true tests/test_schema.py::TestStrictDefault::test_meta_false_init_false
CHANGELOG.rst marshmallow/schema.py
CHANGELOG.rst marshmallow/schema.py