diff --git a/changelog.d/7341.bugfix b/changelog.d/7341.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..8f0958bcb4b98b11072cce0dff20adf4641927e4
--- /dev/null
+++ b/changelog.d/7341.bugfix
@@ -0,0 +1 @@
+Fix bad error handling that would cause Synapse to crash if it's provided with a YAML configuration file that's either empty or doesn't parse into a key-value map.
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index bfa9d28999fffd9b6fca69c758c4ecb76e5d4d6c..30d1050a9181cfd1916b7a0c478b27c768ce93c3 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -657,6 +657,12 @@ def read_config_files(config_files):
     for config_file in config_files:
         with open(config_file) as file_stream:
             yaml_config = yaml.safe_load(file_stream)
+
+        if not isinstance(yaml_config, dict):
+            err = "File %r is empty or doesn't parse into a key-value map. IGNORING."
+            print(err % (config_file,))
+            continue
+
         specified_config.update(yaml_config)
 
     if "server_name" not in specified_config: