aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'db.go')
-rw-r--r--db.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/db.go b/db.go
index c09dd92..658aff4 100644
--- a/db.go
+++ b/db.go
@@ -255,7 +255,11 @@ func dbGetMxPmRoom(protocol string, them connector.UserID, themMxId string, usMx
}
func dbDeletePmRoom(room *DbPmRoomMap) {
- db.Delete(room)
+ if room.ID != 0 {
+ db.Delete(room)
+ } else {
+ log.Warnf("In dbDeletePmRoom: %#v (not deleting since primary key is zero)", room)
+ }
}
func dbGetMxUser(protocol string, userId connector.UserID) (string, error) {