From 8334b6a09f2a74ad7a6652f3d4a3d5ab9beca1a0 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Wed, 27 Nov 2013 15:41:36 +0100 Subject: Fix crash when no instances are available --- logic/lists/InstanceList.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'logic') 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 iter(m_instances); InstancePtr inst; while (iter.hasNext()) -- cgit v1.2.3