Skip to content

Commit

Permalink
Fix: crash on empty theme file settings (Mudlet#7560)
Browse files Browse the repository at this point in the history
<!-- Keep the title short & concise so anyone non-technical can
understand it,
     the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Fix crash on empty theme file settings by assuming the default theme.
#### Motivation for adding to Mudlet
Closes Mudlet#7557
#### Other info (issues closed, discussion etc)
An alternative to Mudlet#7551 - this
solution is more straightforward.

---------

Co-authored-by: Vadim Peretokin <[email protected]>
  • Loading branch information
vadi2 and vadi2 authored Dec 15, 2024
1 parent c06f5a3 commit 3754792
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/XMLimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,10 @@ void XMLimport::readHost(Host* pHost)
pHost->mMapperShowRoomBorders = readDefaultTrueBool(qsl("mMapperShowRoomBorders"));
pHost->mEditorTheme = attributes().value(QLatin1String("mEditorTheme")).toString();
pHost->mEditorThemeFile = attributes().value(QLatin1String("mEditorThemeFile")).toString();
if (pHost->mEditorTheme.isEmpty() || pHost->mEditorThemeFile.isEmpty()) {
pHost->mEditorTheme = qsl("Mudlet");
pHost->mEditorThemeFile = qsl("Mudlet.tmTheme");
}
pHost->mThemePreviewItemID = attributes().value(QLatin1String("mThemePreviewItemID")).toInt();
pHost->mThemePreviewType = attributes().value(QLatin1String("mThemePreviewType")).toString();
pHost->setHaveColorSpaceId(attributes().value(QLatin1String("mSGRCodeHasColSpaceId")).toString() == QLatin1String("yes"));
Expand Down

0 comments on commit 3754792

Please sign in to comment.