fix possible nil
This commit is contained in:
@@ -95,6 +95,10 @@ func (s roomSettings) ContentOptions() *utils.ContentOptions {
|
|||||||
|
|
||||||
func (b *Bot) getRoomSettings(roomID id.RoomID) (roomSettings, error) {
|
func (b *Bot) getRoomSettings(roomID id.RoomID) (roomSettings, error) {
|
||||||
config, err := b.lp.GetRoomAccountData(roomID, acRoomSettingsKey)
|
config, err := b.lp.GetRoomAccountData(roomID, acRoomSettingsKey)
|
||||||
|
if config == nil {
|
||||||
|
config = map[string]string{}
|
||||||
|
}
|
||||||
|
|
||||||
return config, utils.UnwrapError(err)
|
return config, utils.UnwrapError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user