diff options
| author | scorpion-26 <dev.scorpion26@gmail.com> | 2023-04-07 21:15:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-07 20:15:11 +0100 |
| commit | 07e4ba9d80f2fd150bb7ec8e1c8ee0071dd2f3f0 (patch) | |
| tree | 043b0abdd8208912bd0780844ad62dbda3496980 /src/config/ConfigManager.cpp | |
| parent | 5e2d4d644aea80c399ce4b8fddec8e9f1dc996bd (diff) | |
Fix crash in CConfigManager::parseKeyword (#1983)
If debug:manual_crash is set on startup, parseKeyword tries
to call g_pHyprNotificationOverlay->addNotification, but
g_pHyprNotificationOverlay isn't initialized yet (is nullptr)
This commit adds a sanity check for that.
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 7eb4a361..37554ff9 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1164,8 +1164,10 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: // manual crash if (configValues["debug:manual_crash"].intValue && !m_bManualCrashInitiated) { m_bManualCrashInitiated = true; - g_pHyprNotificationOverlay->addNotification("Manual crash has been set up. Set debug:manual_crash back to 0 in order to crash the compositor.", CColor(0), 5000, - ICON_INFO); + if (g_pHyprNotificationOverlay) { + g_pHyprNotificationOverlay->addNotification("Manual crash has been set up. Set debug:manual_crash back to 0 in order to crash the compositor.", CColor(0), 5000, + ICON_INFO); + } } else if (m_bManualCrashInitiated && !configValues["debug:manual_crash"].intValue) { // cowabunga it is g_pHyprRenderer->initiateManualCrash(); |
