Commit 91436c7a authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Heaptrack Analysis: don't crash when no launches are configured

Even if the user created a launch in the opened Launch Configurations
dialog, KDevelop still crashed because the defaultLaunch pointer was not
reassigned and remained null.

The user can dismiss the dialog without configuring a launch. Display an
error message instead of crashing in this case.

BUG: 417308
FIXED-IN: 5.10.221200
parent dc530a28
Pipeline #251052 passed with stage
in 31 minutes and 30 seconds
......@@ -99,9 +99,13 @@ void Plugin::launchHeaptrack()
auto defaultLaunch = runController->defaultLaunch();
if (!defaultLaunch) {
defaultLaunch = runController->defaultLaunch();
if (!defaultLaunch) {
postErrorMessage(i18n("Configure a native application launch to perform Heaptrack analysis on."));
// TODO: catch if still no defaultLaunch
if (!defaultLaunch->type()->launcherForId(QStringLiteral("nativeAppLauncher"))) {
postErrorMessage(i18n("Heaptrack analysis can be started only for native applications."));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment