From f03d1929cb668f0087a8d5943810d9d59af4e2c3 Mon Sep 17 00:00:00 2001 From: Alberto Torres Date: Sat, 21 Sep 2024 02:15:26 +0200 Subject: [PATCH] Blend format: fix crash when trying to load a data block of missing type. --- src/loaders/blend_format.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/blend_format.nim b/src/loaders/blend_format.nim index 9e9576e..14a31ef 100644 --- a/src/loaders/blend_format.nim +++ b/src/loaders/blend_format.nim @@ -122,7 +122,7 @@ proc hash*(n: FNode): Hash = const BASIC_TYPE_LENGTHS = [1, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 0, 1] -template `[]`*(blocks: NamedBlocks, s: string): untyped = blocks[[s[0],s[1]]] +template `[]`*(blocks: NamedBlocks, s: string): untyped = blocks.getOrDefault([s[0],s[1]]) # iterator items*(s: NamedBlocks): seq[FNode] {.borrow.} # iterator pairs*(s: NamedBlocks): (array[2, char], seq[FNode]) {.borrow.}