mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 06:21:25 +00:00
Fix crash calling app.command.LoadPalette() when the UI is not available (fix #3847)
E.g. aseprite -b -script load.lua When load.lua is: app.command.LoadPalette() Was crashing the program.
This commit is contained in:
parent
7a26281ce3
commit
a6ccc45d5b
@ -1,4 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2023 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -62,7 +63,7 @@ void LoadPaletteCommand::onExecute(Context* context)
|
|||||||
filename = m_filename;
|
filename = m_filename;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
else {
|
else if (context->isUIAvailable()) {
|
||||||
base::paths exts = get_readable_palette_extensions();
|
base::paths exts = get_readable_palette_extensions();
|
||||||
base::paths filenames;
|
base::paths filenames;
|
||||||
if (app::show_file_selector(
|
if (app::show_file_selector(
|
||||||
|
Loading…
Reference in New Issue
Block a user