Comments, guard against marshaling nil values

This commit is contained in:
Till Faelligen 2022-10-07 15:07:18 +02:00
parent 4ddd55522a
commit 967d2ab9df
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
2 changed files with 7 additions and 5 deletions

View file

@ -270,10 +270,12 @@ func (r *FederationInternalAPI) performJoinUsingServer(
// If we successfully performed a send_join above then the other // If we successfully performed a send_join above then the other
// server now thinks we're a part of the room. Send the newly // server now thinks we're a part of the room. Send the newly
// returned state to the roomserver to update our local view. // returned state to the roomserver to update our local view.
event, err = event.SetUnsigned(unsigned) if unsigned != nil {
if err != nil { event, err = event.SetUnsigned(unsigned)
// non-fatal, log and continue if err != nil {
logrus.WithError(err).Errorf("Failed to set prev content") // non-fatal, log and continue
logrus.WithError(err).Errorf("Failed to set unsigned content")
}
} }
if err = roomserverAPI.SendEventWithState( if err = roomserverAPI.SendEventWithState(

View file

@ -361,7 +361,7 @@ func (r *Joiner) performFederatedJoinRoomByID(
UserID: req.UserID, // the user ID joining the room UserID: req.UserID, // the user ID joining the room
ServerNames: req.ServerNames, // the server to try joining with ServerNames: req.ServerNames, // the server to try joining with
Content: req.Content, // the membership event content Content: req.Content, // the membership event content
Unsigned: req.Unsigned, Unsigned: req.Unsigned, // the unsigned event content, if any
} }
fedRes := fsAPI.PerformJoinResponse{} fedRes := fsAPI.PerformJoinResponse{}
r.FSAPI.PerformJoin(ctx, &fedReq, &fedRes) r.FSAPI.PerformJoin(ctx, &fedReq, &fedRes)