mirror of https://github.com/aseprite/aseprite.git
Fix crash (and show error message) when default font is nullptr (fix #5208)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run
Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run
Details
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run
Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run
Details
Probably an edge-case for users that are creating new themes.
This commit is contained in:
parent
2be4dc1474
commit
2bc4f0582d
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018-2024 Igara Studio S.A.
|
// Copyright (C) 2018-2025 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
|
||||||
|
@ -48,9 +48,12 @@ public:
|
||||||
|
|
||||||
// When the main window is closed, we should close the console (in
|
// When the main window is closed, we should close the console (in
|
||||||
// other case the main message loop will continue running for the
|
// other case the main message loop will continue running for the
|
||||||
// console too).
|
// console too). The main window can be nullptr if the console is
|
||||||
m_mainWindowClosedConn = App::instance()->mainWindow()->Close.connect(
|
// used to show an error when loading the default theme or font at
|
||||||
[this] { closeWindow(nullptr); });
|
// the initialization.
|
||||||
|
if (auto* mainWin = App::instance()->mainWindow()) {
|
||||||
|
m_mainWindowClosedConn = mainWin->Close.connect([this] { closeWindow(nullptr); });
|
||||||
|
}
|
||||||
|
|
||||||
// When the window is closed, we clear the text
|
// When the window is closed, we clear the text
|
||||||
Close.connect([this] {
|
Close.connect([this] {
|
||||||
|
|
|
@ -545,6 +545,13 @@ void SkinTheme::loadXml(BackwardCompatibility* backward)
|
||||||
|
|
||||||
text::FontRef font = fontData->getFont(m_fontMgr, size * ui::guiscale());
|
text::FontRef font = fontData->getFont(m_fontMgr, size * ui::guiscale());
|
||||||
|
|
||||||
|
// No font?
|
||||||
|
if (font == nullptr) {
|
||||||
|
LOG(ERROR, "THEME: Error loading font for theme %s\n", idStr);
|
||||||
|
xmlFont = xmlFont->NextSiblingElement();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// SpriteSheetFonts have a default preferred size.
|
// SpriteSheetFonts have a default preferred size.
|
||||||
if (size == 0.0f && font->defaultSize() > 0.0f) {
|
if (size == 0.0f && font->defaultSize() > 0.0f) {
|
||||||
size = font->defaultSize();
|
size = font->defaultSize();
|
||||||
|
|
Loading…
Reference in New Issue