aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2021-11-16 09:25:36 +0000
committerNeil Alexander <neilalexander@users.noreply.github.com>2021-11-16 09:25:36 +0000
commitddbef7c3ffb6b5efe87a7a841c7418bd73337b8b (patch)
treea6a1881da61a9c2b1ed47747cc0115e3cbad2cbf
parent58b831ad3632f2a4346328c26eac906c9ed3b45c (diff)
Fix panic in federationsender consumer
-rw-r--r--federationsender/consumers/keychange.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/federationsender/consumers/keychange.go b/federationsender/consumers/keychange.go
index a9f6d0f8..2c366e50 100644
--- a/federationsender/consumers/keychange.go
+++ b/federationsender/consumers/keychange.go
@@ -95,6 +95,12 @@ func (t *KeyChangeConsumer) onMessage(msg *sarama.ConsumerMessage) error {
}
func (t *KeyChangeConsumer) onDeviceKeyMessage(m api.DeviceMessage) error {
+ if m.DeviceKeys == nil && m.OutputCrossSigningKeyUpdate == nil {
+ // This probably shouldn't happen but stops us from panicking if we come
+ // across an update that doesn't satisfy either types.
+ return nil
+ }
+
logger := logrus.WithField("user_id", m.UserID)
// only send key change events which originated from us