Skip to content

Editing a message containing a list with an empy last value will crash the client #711

@Thunderhelm

Description

@Thunderhelm

Describe the bug

When attempting to edit a message containing a formatted ordered or unordered list, if the final entry in the list contains no text, the client will crash with the following error:

Error: Cannot get the end point in the node at path [1] because it has no end text node.
    at oot (https://app.sable.moe/assets/index-CyIDp8UT.js:115497:32)
    at Object.point (https://app.sable.moe/assets/index-CyIDp8UT.js:116763:16)
    at Object.point (https://app.sable.moe/assets/index-CyIDp8UT.js:114171:16)
    at Cit (https://app.sable.moe/assets/index-CyIDp8UT.js:115145:25)
    at Object.end (https://app.sable.moe/assets/index-CyIDp8UT.js:116643:16)
    at Object.end (https://app.sable.moe/assets/index-CyIDp8UT.js:114068:16)
    at https://app.sable.moe/assets/index-CyIDp8UT.js:115928:27
    at Fot (https://app.sable.moe/assets/index-CyIDp8UT.js:115713:7)
    at Object.withoutNormalizing (https://app.sable.moe/assets/index-CyIDp8UT.js:116847:16)
    at Object.withoutNormalizing (https://app.sable.moe/assets/index-CyIDp8UT.js:114213:9)

This happens whether or not markdown is enabled.

Reproduction

  1. enter any text chat
  2. send a message formatted like either of the following
test
• test
•
test
1. test
2. 
  1. attempt to press the edit widget on the message

Expected behavior

The client would handle the final value being empty by letting it remain empty when initially editing.

Platform and versions

1. OS: Linux Mint 22.3 - Xfce
2. Browser: Sable's electron client (specifically from the README hyper-link)
3. Sable version: 0.5.7 (c927bc7b)
4. Matrix homeserver: bearware.dev (running c10y)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug/behaviourbehaviour bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions