Fixed bug in `syncMesToSwipe`. `""` is falsy and a valid message. (#4733) * Fixed bug in `syncMesToSwipe`. * Use strict inequality operator --------- Co-authored-by: user <user@exmaple.com> Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Signed| @@ -6258,7 +6258,8 @@ export function syncMesToSwipe(messageId = null) { | ||
| 6258 | 6258 | return false; |
| 6259 | 6259 | } |
| 6260 | 6260 | // If the swipe is not present yet, exit out (will likely be copied later) |
| 6261 | - if (!targetMessage.swipes[targetMessage.swipe_id] || !targetMessage.swipe_info[targetMessage.swipe_id]) { | |
| 6261 | + // "" is falsy. An empty string is a valid message. | |
| 6262 | + if (typeof targetMessage.swipes[targetMessage.swipe_id] !== 'string' || !targetMessage.swipe_info[targetMessage.swipe_id]) { | |
| 6262 | 6263 | return false; |
| 6263 | 6264 | } |
| 6264 | 6265 | |