fix: Window header always displaying (Read Only) after opening a provider

This commit is contained in:
WerWolv
2022-08-22 11:00:31 +02:00
parent c0a5e2012f
commit dacb64ae66
2 changed files with 12 additions and 6 deletions

View File

@@ -114,14 +114,15 @@ namespace hex {
if (ImHexApi::Provider::isValid()) {
auto provider = ImHexApi::Provider::get();
if (!windowTitle.empty())
if (!windowTitle.empty() && provider != nullptr) {
title += " - " + windowTitle;
if (provider->isDirty())
title += " (*)";
if (provider->isDirty())
title += " (*)";
if (!provider->isWritable())
title += " (Read Only)";
if (!provider->isWritable())
title += " (Read Only)";
}
}
this->m_windowTitle = title;