summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-01-28 17:26:39 +0000
committerErik Johnston <erik@matrix.org>2019-01-28 17:26:39 +0000
commitd758d5310e5a5753f181d0eef447acb1a3dd29cc (patch)
tree4b0ba3b91029ee33a5c4f1a003a3b14b29fc02c5 /synapse
parentNewsfile (diff)
downloadsynapse-d758d5310e5a5753f181d0eef447acb1a3dd29cc.tar.xz
Correctly use default room version if none is set
Diffstat (limited to '')
-rw-r--r--synapse/handlers/message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 10a7ed4c5e..67b364a6c3 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -22,7 +22,7 @@ from canonicaljson import encode_canonical_json, json
 from twisted.internet import defer
 from twisted.internet.defer import succeed
 
-from synapse.api.constants import MAX_DEPTH, EventTypes, Membership
+from synapse.api.constants import MAX_DEPTH, EventTypes, Membership, RoomVersions
 from synapse.api.errors import (
     AuthError,
     Codes,
@@ -612,7 +612,7 @@ class EventCreationHandler(object):
         """
 
         if event.is_state() and (event.type, event.state_key) == (EventTypes.Create, ""):
-            room_version = event.content["room_version"]
+            room_version = event.content.get("room_version", RoomVersions.V1)
         else:
             room_version = yield self.store.get_room_version(event.room_id)