Skip to content

Commit

Permalink
fix: ensure queries coalesce album_id value when scanning
Browse files Browse the repository at this point in the history
Otherwise databases with existing messages that don't have an `album_id`
will run into and `converting NULL to string is unsupported` error.

See: #3021 (comment)
  • Loading branch information
0x-r4bbit committed Dec 16, 2022
1 parent 4a0eb56 commit 35753f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol/message_persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (db sqlitePersistence) tableUserMessagesAllFieldsJoin() string {
m1.sticker_hash,
m1.image_payload,
m1.image_type,
m1.album_id,
COALESCE(m1.album_id, ""),
COALESCE(m1.audio_duration_ms,0),
m1.community_id,
m1.mentions,
Expand Down

0 comments on commit 35753f7

Please sign in to comment.