# Buggy code
def match(self, node):
    # type: (nodes.image) -> bool
    if self.app.builder.supported_remote_images == []:
        return False
    elif self.app.builder.supported_data_uri_images is True:
        return False
    else:
        return "data:" in node["uri"]


# Traceback (AttributeError)
# Sphinx version: 2.1.2
# Python version: 3.7.4 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.1
# Last messages:
#
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [100%] index
# Loaded extensions:
#   sphinx.ext.mathjax (2.1.2) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.1) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.1) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.2) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.3) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.2) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/alabaster/__init__.py
Traceback (most recent call last):
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/cmd/build.py", line 284, in build_main
app.build(args.force_all, filenames)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/application.py", line 345, in build
self.builder.build_update()
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 319, in build_update
len(to_build))
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/builders/gettext.py", line 264, in build
super().build(docnames, summary, method)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 382, in build
self.write(docnames, list(updated_docnames), method)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 562, in write
self._write_serial(sorted(docnames))
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 570, in _write_serial
doctree = self.env.get_and_resolve_doctree(docname, self)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 554, in get_and_resolve_doctree
self.apply_post_transforms(doctree, docname)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 601, in apply_post_transforms
transformer.apply_transforms()
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/transforms/__init__.py", line 90, in apply_transforms
super().apply_transforms()
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/docutils/transforms/__init__.py", line 172, in apply_transforms
transform.apply(**kwargs)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/transforms/post_transforms/images.py", line 40, in apply
self.handle(node)
File "/Users/blueset/Codebase/efb-dev-env/lib/python3.7/site-packages/sphinx/transforms/post_transforms/images.py", line 140, in handle
ext = get_image_extension(image.mimetype)
AttributeError: 'NoneType' object has no attribute 'mimetype'

# Fixed code
def match(self, node):
    # type: (nodes.image) -> bool
    if self.app.builder.supported_remote_images == []:
        return False
    elif self.app.builder.supported_data_uri_images is True:
        return False
    else:
        return node["uri"].startswith("data:")