Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wxwisiasdf committed Jan 7, 2024
1 parent fed9d2c commit c3bb1a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/gui_minimap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class macro_builder_template_select : public button_element_base {
public:
void button_action(sys::state& state) noexcept override {
auto index = retrieve<uint32_t>(state, parent);
if(index >= uint32_t(state.ui_state.templates.size()))
return;
std::memcpy(&state.ui_state.current_template, &state.ui_state.templates[index], sizeof(sys::macro_builder_template));
send(state, parent, notify_template_select{});
}
Expand Down Expand Up @@ -687,7 +689,8 @@ class macro_builder_window : public window_element_base {
} else if(payload.holds_type< notify_template_select>()) {
auto const& name = state.ui_state.current_template.name;
auto sv = std::string_view(name, name + sizeof(name));
name_input->set_text(state, std::string(sv));
auto s = std::string(sv);
name_input->set_text(state, s);
impl_on_update(state);
return message_result::consumed;
} else if(payload.holds_type<notify_setting_update>()) {
Expand Down

0 comments on commit c3bb1a6

Please sign in to comment.