From 319f5f33a57afbb6955145b0b6963e23fb68e1d2 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 13 Nov 2018 14:09:42 +0100
Subject: [PATCH] [MeL] Use new {exists,get}PropertyVector.

This versions check if the PropertyVector is
assigned to the requested mesh item type and has
the required number of components.
---
 MeshLib/Mesh.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp
index 57a148fa85e..df785587367 100644
--- a/MeshLib/Mesh.cpp
+++ b/MeshLib/Mesh.cpp
@@ -342,8 +342,10 @@ void scaleMeshPropertyVector(MeshLib::Mesh & mesh,
 PropertyVector<int> const* materialIDs(Mesh const& mesh)
 {
     auto const& properties = mesh.getProperties();
-    return properties.existsPropertyVector<int>("MaterialIDs")
-               ? properties.getPropertyVector<int>("MaterialIDs")
+    return properties.existsPropertyVector<int>("MaterialIDs",
+                                                MeshLib::MeshItemType::Cell, 1)
+               ? properties.getPropertyVector<int>(
+                     "MaterialIDs", MeshLib::MeshItemType::Cell, 1)
                : nullptr;
 }
 
-- 
GitLab