From e65e4b770e7a7bb70d4cfffb9626c2a2e5ec6ac7 Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Thu, 2 May 2024 10:24:01 +0200 Subject: [PATCH] Accessors.getNodePropertyOption: ensure we never return `Some(null)` --- core/src/main/scala/flatgraph/Accessors.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/flatgraph/Accessors.scala b/core/src/main/scala/flatgraph/Accessors.scala index 08af2757..c3753edb 100644 --- a/core/src/main/scala/flatgraph/Accessors.scala +++ b/core/src/main/scala/flatgraph/Accessors.scala @@ -136,7 +136,7 @@ object Accessors { if (qty == null || seq + 1 >= qty.length || qty(seq) == qty(seq + 1)) return None if (qty(seq + 1) - qty(seq) != 1) ??? val vals = graph.properties(pos + 1).asInstanceOf[Array[T]] // cast is checked for primitives and unchecked for reftypes - Some(vals(qty(seq))) + Option(vals(qty(seq))) } def getNodePropertyOptionCompat(node: GNode, propertyKind: Int): Option[Object] = {