ImGui.NET
                                
                                
                                
                                    ImGui.NET copied to clipboard
                            
                            
                            
                        Button with empty string as label crashes
This crashes...
public class Button : Pressable
{
    protected override void OnRender(float dt)
    {
        base.OnRender(dt);
        var id = (Label == "" ? " " : Label) + "###" + GetHashCode();
        if (ImGui.Button(id)) // Crashes
            Pressed = true;
    }
}
This is where it reaches before terminating the program.

What a code abortion :P
var id = (Label == "" ? " " : Label) + "###" + GetHashCode();
Could have 'Label' as a nullable string, also why do you want it to start with white space if Label == string.Empty?
var id = $"###{Label}{GetHashCode()}";
What a code abortion :P
var id = (Label == "" ? " " : Label) + "###" + GetHashCode();Could have 'Label' as a nullable string, also why do you want it to start with white space if Label == string.Empty?
var id = $"###{Label}{GetHashCode()}";
I thought the empty or null string was the problem. turns out it wasn't