maplocationmodel: fix getMapLocationForUuid()

This method did not return NULL properly if a MapLocation does
not exists in the list.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-27 23:08:46 +03:00 committed by Dirk Hohndel
parent 0955a5b36a
commit f6e269c07a

View file

@ -129,10 +129,10 @@ quint32 MapLocationModel::selectedUuid()
MapLocation *MapLocationModel::getMapLocationForUuid(quint32 uuid)
{
MapLocation *location = NULL;
MapLocation *location;
foreach(location, m_mapLocations) {
if (location->getRole(MapLocation::Roles::RoleUuid) == uuid)
break;
if (uuid == location->uuid())
return location;
}
return location;
return NULL;
}