From f169ffa8dc3ce1f927711970d3497d656b9255c2 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 8 Oct 2022 17:41:34 -0500 Subject: [PATCH] GUI: fix assert fail when removing ins thru rgtclk --- src/gui/dataList.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index 7199e513..9a1740be 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -436,9 +436,11 @@ void FurnaceGUI::drawInsList(bool asChild) { } } if (i>=0) { - DivInstrument* ins=e->song.ins[i]; - ImGui::SameLine(); - ImGui::Text("%.2X: %s",i,ins->name.c_str()); + if (i<(int)e->song.ins.size()) { + DivInstrument* ins=e->song.ins[i]; + ImGui::SameLine(); + ImGui::Text("%.2X: %s",i,ins->name.c_str()); + } } else { ImGui::SameLine(); ImGui::Text("- None -");