Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crash when opening NXM link before selecting instance #2144

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/moapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,14 @@ void MOApplication::externalMessage(const QString& message)
}
}
} else if (isNxmLink(message)) {
MessageDialog::showMessage(tr("Download started"), qApp->activeWindow(), false);
m_core->downloadRequestedNXM(message);
if (InstanceManager::singleton().currentInstance()->gamePlugin() == nullptr) {
// This can happen if MO2 is started with the --pick option and no instance has
// been selected yet, in which case m_core will be null.
reportError(tr("You need to select an instance before trying to download mods."));
} else {
MessageDialog::showMessage(tr("Download started"), qApp->activeWindow(), false);
m_core->downloadRequestedNXM(message);
}
} else {
cl::CommandLine cl;

Expand Down
Loading