From b0875e1fa0f13935d6ac06a24dc6300a821f7652 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 1 May 2025 16:27:22 -0400 Subject: Add check for null type --- src/stdlib/stdlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stdlib') diff --git a/src/stdlib/stdlib.c b/src/stdlib/stdlib.c index 71257b8e..54c7827f 100644 --- a/src/stdlib/stdlib.c +++ b/src/stdlib/stdlib.c @@ -502,7 +502,7 @@ public void end_inspect(const void *expr, const TypeInfo_t *type) { _inspect_depth -= 1; - if (type->metamethods.as_text) { + if (type && type->metamethods.as_text) { Text_t expr_text = generic_as_text(expr, USE_COLOR, type); Text_t type_name = generic_as_text(NULL, false, type); for (int i = 0; i < 3*_inspect_depth; i++) fputc(' ', stdout); -- cgit v1.2.3