diff --git a/src/main/scala/scalismo/io/ply/PLYHelpers.scala b/src/main/scala/scalismo/io/ply/PLYHelpers.scala index 03514a23..9cc53f30 100644 --- a/src/main/scala/scalismo/io/ply/PLYHelpers.scala +++ b/src/main/scala/scalismo/io/ply/PLYHelpers.scala @@ -110,9 +110,9 @@ object PLYHelpers { } def getFacePropertyIndex(items: Seq[PLYProperty]): PropertyFaceIndexes = { - val faceIndex: Option[Int] = VERTEX_INDEX_PROPERTY_NAMES.collectFirst { f => + val faceIndex: Option[Int] = VERTEX_INDEX_PROPERTY_NAMES.flatMap { f => getPropertyIndex(items, f) - }.flatten + }.headOption PropertyFaceIndexes(faceIndex) }