Skip to content

Cloning an object ending with a number create an exception #228

Closed

Description

@jonadem

Describe the bug
Cloning an object ending with a number create an exception

To Reproduce
Steps to reproduce the behavior:

  1. Go to the "Object dictionary" pane
  2. Rename an object to add a number at the end
  3. Clone this object
  4. See error

Version used
Latest

Expected behavior
Being able to clone the object without an exception message (or a message that cloning an object with a name ending with a number is not allowed)

Activity

  1. nimrof commented on Jul 25, 2026

    @nimrof
    Collaborator

    Sorry for late reply.
    Confirmed

    It is because the regex at the top here tries to detect numbers and increment them.
    The bug is triggered because it does not work with words that ends with numbers, only numbers separated by space.
    It tries to parse the word+number as a int and that fails causing the crash

    https://github.com/CANopenNode/CANopenEditor/blob/main/EDSEditorGUI/InsertObjects.cs#L162-L171

    I will try to fix, but if anyone else would like a go please go ahead.

  2. self-assigned this
    on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions