Skip to content

Commit 1a1e505

Browse files
committed
fix nullptr deref for m_field.
1 parent 58e8723 commit 1a1e505

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/opengl/main/gui/gui.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ void gui::hovered_tiles_panel()
12061206
}
12071207
void gui::combo_coo()
12081208
{
1209-
bool remaster = m_field->is_remaster_from_fl_paths();
1209+
bool remaster = m_field && m_field->is_remaster_from_fl_paths();
12101210
if (!remaster)
12111211
{
12121212
return;
@@ -2447,7 +2447,7 @@ void gui::file_menu()
24472447
{
24482448
return;
24492449
}
2450-
bool remaster = m_field->is_remaster_from_fl_paths();
2450+
bool remaster = m_field && m_field->is_remaster_from_fl_paths();
24512451
if (remaster && ImGui::BeginMenu(gui_labels::language.data()))
24522452
{
24532453
const auto end_menu1 = glengine::ScopeGuard(&ImGui::EndMenu);
@@ -4245,7 +4245,8 @@ gui::gui(GLFWwindow *const window)
42454245
});
42464246

42474247
m_filter_window.register_is_remaster_callback(
4248-
[this]() -> bool { return m_field->is_remaster_from_fl_paths(); });
4248+
[this]() -> bool
4249+
{ return m_field && m_field->is_remaster_from_fl_paths(); });
42494250

42504251
if (m_field)
42514252
{

0 commit comments

Comments
 (0)