aboutsummaryrefslogtreecommitdiff
path: root/syncapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2021-11-16 09:27:49 +0000
committerNeil Alexander <neilalexander@users.noreply.github.com>2021-11-16 09:27:49 +0000
commita9e715b5c5abb658989846d7a6b5f50fab250957 (patch)
tree2ff2dfe714eee7d86a2cdac700dc1354643bcd94 /syncapi
parentddbef7c3ffb6b5efe87a7a841c7418bd73337b8b (diff)
Guard in all key consumers
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/consumers/keychange.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/syncapi/consumers/keychange.go b/syncapi/consumers/keychange.go
index 1938ff9b..dfedc640 100644
--- a/syncapi/consumers/keychange.go
+++ b/syncapi/consumers/keychange.go
@@ -109,6 +109,11 @@ func (s *OutputKeyChangeEventConsumer) onMessage(msg *sarama.ConsumerMessage) er
logrus.WithError(err).Errorf("failed to read device message from key change topic")
return nil
}
+ 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
+ }
switch m.Type {
case api.TypeCrossSigningUpdate:
return s.onCrossSigningMessage(m, msg.Offset, msg.Partition)