summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-11-27 15:41:36 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-30 12:28:35 +0100
commit8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0 (patch)
treec35136ca60ae5a031d8c1503752fc47e3373a445 /logic
parent88318561724cae6d19f892adf778d85e6c736391 (diff)
downloadMultiMC-8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0.tar
MultiMC-8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0.tar.gz
MultiMC-8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0.tar.lz
MultiMC-8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0.tar.xz
MultiMC-8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0.zip
Fix crash when no instances are available
Diffstat (limited to 'logic')
-rw-r--r--logic/lists/InstanceList.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp
index 200b02df..72748b5f 100644
--- a/logic/lists/InstanceList.cpp
+++ b/logic/lists/InstanceList.cpp
@@ -364,6 +364,11 @@ int InstanceList::add(InstancePtr t)
InstancePtr InstanceList::getInstanceById(QString instId) const
{
+ if (m_instances.isEmpty())
+ {
+ return InstancePtr();
+ }
+
QListIterator<InstancePtr> iter(m_instances);
InstancePtr inst;
while (iter.hasNext())