mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Fix crash clicking "Hide Other Layers" when there is no preview window (fix #4768)
Clicking "View > Preview > Hide Other Layers" would try to access the Preview editor when it's nullptr.
This commit is contained in:
parent
0ace79f979
commit
5c62fd68de
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2023 Igara Studio S.A.
|
||||
// Copyright (C) 2023-2024 Igara Studio S.A.
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -87,7 +87,10 @@ void ToggleOtherLayersOpacityCommand::onExecute(Context* ctx)
|
||||
if (params().preview()) {
|
||||
PreviewEditorWindow* previewWin =
|
||||
App::instance()->mainWindow()->getPreviewEditor();
|
||||
previewWin->previewEditor()->invalidate();
|
||||
if (previewWin &&
|
||||
previewWin->previewEditor()) {
|
||||
previewWin->previewEditor()->invalidate();
|
||||
}
|
||||
}
|
||||
else {
|
||||
app_refresh_screen();
|
||||
|
Loading…
x
Reference in New Issue
Block a user