diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 5030196348..b6f95e30c0 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -747,7 +747,9 @@ Print::ApplyStatus BackgroundSlicingProcess::apply(const Model& model, const Dyn // Orca: prevent resetting under gcode viewer mode if (invalidated != PrintBase::APPLY_STATUS_UNCHANGED) { - const auto plater = GUI::wxGetApp().mainframe->m_plater; + // Use the app’s plater accessor instead of going through mainframe, otherwise anything during startup that reaches apply() + // (loading presets, config or input files, e.g. from the CLI) therefore dereferences a null `mainframe` and crashes. + const auto plater = GUI::wxGetApp().plater(); if (plater && plater->only_gcode_mode()) { invalidated = PrintBase::APPLY_STATUS_UNCHANGED; }