diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d24fdd5..475e50c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,16 @@
 Changelog
 ---------
 
+3.3.1 (unreleased)
+******************
+
+Bug fixes:
+
+- Fix ``MarshmallowPlugin`` crash when ``resolve_schema_dict`` is passed a
+  schema as string and ``schema_name_resolver`` returns ``None``
+  (:issue:`566`). Thanks :user:`black3r` for reporting and thanks
+  :user:`Bangterm` for the PR.
+
 3.3.0 (2020-02-14)
 ******************
 
diff --git a/src/apispec/ext/marshmallow/openapi.py b/src/apispec/ext/marshmallow/openapi.py
index 8cf3460..a79172d 100644
--- a/src/apispec/ext/marshmallow/openapi.py
+++ b/src/apispec/ext/marshmallow/openapi.py
@@ -93,7 +93,7 @@ class OpenAPIConverter(FieldConverterMixin):
             name = self.schema_name_resolver(schema)
             if not name:
                 try:
-                    json_schema = self.schema2jsonschema(schema)
+                    json_schema = self.schema2jsonschema(schema_instance)
                 except RuntimeError:
                     raise APISpecError(
                         "Name resolver returned None for schema {schema} which is "

diff --git a/tests/test_ext_marshmallow.py b/tests/test_ext_marshmallow.py
index a5a91bd..4755ad7 100644
--- a/tests/test_ext_marshmallow.py
+++ b/tests/test_ext_marshmallow.py
@@ -558,6 +558,55 @@ class TestOperationHelper:
             "schema"
         ] == build_ref(spec, "schema", "Pet")
 
+    @pytest.mark.parametrize(
+        "pet_schema", (PetSchema, PetSchema(), "tests.schemas.PetSchema"),
+    )
+    def test_schema_name_resolver_returns_none_v2(self, pet_schema):
+        def resolver(schema):
+            return None
+
+        spec = APISpec(
+            title="Test resolver returns None",
+            version="0.1",
+            openapi_version="2.0",
+            plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
+        )
+        spec.path(
+            path="/pet",
+            operations={"get": {"responses": {200: {"schema": pet_schema}}}},
+        )
+        get = get_paths(spec)["/pet"]["get"]
+        assert "properties" in get["responses"]["200"]["schema"]
+
+    @pytest.mark.parametrize(
+        "pet_schema", (PetSchema, PetSchema(), "tests.schemas.PetSchema"),
+    )
+    def test_schema_name_resolver_returns_none_v3(self, pet_schema):
+        def resolver(schema):
+            return None
+
+        spec = APISpec(
+            title="Test resolver returns None",
+            version="0.1",
+            openapi_version="3.0.0",
+            plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
+        )
+        spec.path(
+            path="/pet",
+            operations={
+                "get": {
+                    "responses": {
+                        200: {"content": {"application/json": {"schema": pet_schema}}}
+                    }
+                }
+            },
+        )
+        get = get_paths(spec)["/pet"]["get"]
+        assert (
+            "properties"
+            in get["responses"]["200"]["content"]["application/json"]["schema"]
+        )
+
     @pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
     def test_schema_uses_ref_in_parameters_and_request_body_if_available_v2(
         self, spec_fixture

Marshmallow plugin bug with string schema ref and schema_name_resolver
`resolve_schema_dict` claims to support `string` as its schema parameter type. It can get there for example when you are parsing schema from docstring using the provided yaml util, or using FlaskPlugin to do it for you. 

But, when `schema_name_resolver` returns `None` for this case, the schema gets forwarded to `schema2jsonschema` which expects a `marshmallow.Schema` instance and crashes.

Test case is a slightly modified "example application": 
<details>
<summary>Show example test case</summary>

```python
import uuid

from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_webframeworks.flask import FlaskPlugin
from flask import Flask, jsonify
from marshmallow import fields, Schema


def schema_name_resolver(schema):
    if schema == "PetSchema":
        return None


# Create an APISpec
spec = APISpec(
    title="Swagger Petstore",
    version="1.0.0",
    openapi_version="3.0.2",
    plugins=[
        FlaskPlugin(),
        MarshmallowPlugin(schema_name_resolver=schema_name_resolver),
    ],
)


# Optional marshmallow support
class CategorySchema(Schema):
    id = fields.Int()
    name = fields.Str(required=True)


class PetSchema(Schema):
    categories = fields.List(fields.Nested(CategorySchema))
    name = fields.Str()


# Optional Flask support
app = Flask(__name__)


@app.route("/random")
def random_pet():
    """A cute furry animal endpoint.
    ---
    get:
      description: Get a random pet
      responses:
        200:
          description: Return a pet
          content:
            application/json:
              schema: PetSchema
    """
    # Hardcoded example data
    pet_data = {
        "name": "sample_pet_" + str(uuid.uuid1()),
        "categories": [{"id": 1, "name": "sample_category"}],
    }
    return PetSchema().dump(pet_data)


# Register the path and the entities within it
with app.test_request_context():
    spec.path(view=random_pet)


@app.route("/spec.json")
def get_spec():
    return jsonify(spec.to_dict())
```
</details>

<details>
<summary>Show example stacktrace</summary>

```
Traceback (most recent call last):
  File "/home//PycharmProjects/test-apispec/main.py", line 62, in <module>
    spec.path(view=random_pet)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/core.py", line 280, in path
    plugin.operation_helper(path=path, operations=operations, **kwargs)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/__init__.py", line 202, in operation_helper
    self.resolver.resolve_response(response)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/schema_resolver.py", line 113, in resolve_response
    self.resolve_schema(response)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/schema_resolver.py", line 161, in resolve_schema
    content["schema"] = self.resolve_schema_dict(content["schema"])
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/schema_resolver.py", line 218, in resolve_schema_dict
    return self.converter.resolve_nested_schema(schema)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/openapi.py", line 96, in resolve_nested_schema
    json_schema = self.schema2jsonschema(schema)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/openapi.py", line 261, in schema2jsonschema
    fields = get_fields(schema)
  File "/home//.local/share/virtualenvs/test-apispec-HubT4B3L/lib/python3.8/site-packages/apispec/ext/marshmallow/common.py", line 63, in get_fields
    raise ValueError(
ValueError: 'PetSchema' doesn't have either `fields` or `_declared_fields`.
```
</details>

I think it should be enough to just pass `schema_instance` instead of `schema` to `self.schema2jsonschema` in `resolve_nested_schema`
tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]
tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0] tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1] tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1] tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0] tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0] tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2 tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3 tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0] tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0] tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0] tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0] tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0] tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0] tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0] tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0] tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0] tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0] tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0] tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0] tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0] tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0] tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0] tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0] tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0] tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0] tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]