priyasirohi09 / joplin

Other
2 stars 91 forks source link

Issue: Crash When Opening Plugin Dialogs Due to Improper ClassName Handling #279

Closed SyedAyaanAli6786 closed 3 months ago

SyedAyaanAli6786 commented 3 months ago

Operating system

Windows

Joplin version

Joplin 2.13.9 (prod, darwin)

Desktop version info

No response

Current behaviour

Current Behavior

When opening certain plugin dialogs, such as the Freehand Drawing plugin's drawing dialog, the application crashes. This crash occurs because the className property of the dialog can start or end with a space. When the className is split using the regular expression \s+, an empty string is included in the resulting array. The code then attempts to add this empty string as a CSS class, leading to the following error:

Expected behaviour

Expected Behavior

When opening plugin dialogs, the application should handle the className property correctly, even if it contains leading or trailing spaces. The className string should be sanitized to remove any empty strings before attempting to add CSS classes. This would prevent the crash and allow the dialogs, including the Freehand Drawing plugin's dialog, to open without issues.

Logs

No response

SyedAyaanAli6786 commented 3 months ago

@priyasirohi09 Can you assign this issue to me?