AbstractModel: Check if index is valid in setData
It would otherwise crash in MapBase::objectAt because it doesn't check the map bounds.