summaryrefslogtreecommitdiff
path: root/src/processrunner.cpp
diff options
context:
space:
mode:
authorSeth Riley <17361645+Qudix@users.noreply.github.com>2020-11-06 12:02:43 -0600
committerSeth Riley <17361645+Qudix@users.noreply.github.com>2020-11-06 12:02:43 -0600
commited1085d5673e0d307a6172eaaa1be1e9d70e2234 (patch)
tree1e068a2f08e106c8ce15be7034f19336836cc17a /src/processrunner.cpp
parent34e1d05c28bf4676ed8d3e97e969187a05d215b6 (diff)
parentb909677c3fc6a7b7a1993d341a2bd420715e292a (diff)
Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer into master
Diffstat (limited to 'src/processrunner.cpp')
-rw-r--r--src/processrunner.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index a0e74f47..bc4e6227 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -586,13 +586,16 @@ ProcessRunner& ProcessRunner::setFromExecutable(const Executable& exe)
ProcessRunner& ProcessRunner::setFromShortcut(const MOShortcut& shortcut)
{
- const auto currentInstance = InstanceManager::instance().currentInstance();
+ const auto currentInstance = InstanceManager::singleton().currentInstance();
- if (shortcut.hasInstance() && shortcut.instance() != currentInstance) {
- throw std::runtime_error(
- QString("Refusing to run executable from different instance %1:%2")
- .arg(shortcut.instance(),shortcut.executable())
- .toLocal8Bit().constData());
+ if (currentInstance)
+ {
+ if (shortcut.hasInstance() && shortcut.instance() != currentInstance->name()) {
+ throw std::runtime_error(
+ QString("Refusing to run executable from different instance %1:%2")
+ .arg(shortcut.instance(),shortcut.executable())
+ .toLocal8Bit().constData());
+ }
}
const Executable& exe = m_core.executablesList()->get(shortcut.executable());