From ad65ff69d3ddeaf3b34cc9038bc28e79692f9656 Mon Sep 17 00:00:00 2001 From: rodri Date: Tue, 20 Feb 2024 16:50:13 +0000 Subject: don't try to find a material when the list is empty. --- obj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obj.c b/obj.c index de1c458..ef3f0fb 100644 --- a/obj.c +++ b/obj.c @@ -738,7 +738,7 @@ Line2: *p++ = c; }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_') && p-buf < sizeof(buf)-1); *p = 0; - if((m = getmtl(obj->materials, buf)) == nil){ + if(obj->materials != nil && (m = getmtl(obj->materials, buf)) == nil){ error("no material '%s' found", buf); goto error; } -- cgit v1.2.3