Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Pass a dict, instead of None, to modules if a None config is specified in the homeserver config #9229

Merged
merged 3 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9229.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug where `None` was passed to Synapse modules instead of an empty dictionary if an empty module `config` block was provided in the homeserver config.
3 changes: 2 additions & 1 deletion synapse/util/module_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def load_module(provider: dict, config_path: Iterable[str]) -> Tuple[Type, Any]:
module = importlib.import_module(module)
provider_class = getattr(module, clz)

module_config = provider.get("config")
# Load the module config. If None, pass an empty dictionary instead
module_config = provider.get("config") or {}
try:
provider_config = provider_class.parse_config(module_config)
except jsonschema.ValidationError as e:
Expand Down