Fix crash when no instances are available
This commit is contained in:
parent
8831856172
commit
8334b6a09f
@ -364,6 +364,11 @@ int InstanceList::add(InstancePtr t)
|
|||||||
|
|
||||||
InstancePtr InstanceList::getInstanceById(QString instId) const
|
InstancePtr InstanceList::getInstanceById(QString instId) const
|
||||||
{
|
{
|
||||||
|
if (m_instances.isEmpty())
|
||||||
|
{
|
||||||
|
return InstancePtr();
|
||||||
|
}
|
||||||
|
|
||||||
QListIterator<InstancePtr> iter(m_instances);
|
QListIterator<InstancePtr> iter(m_instances);
|
||||||
InstancePtr inst;
|
InstancePtr inst;
|
||||||
while (iter.hasNext())
|
while (iter.hasNext())
|
||||||
|
Loading…
Reference in New Issue
Block a user