aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/stdlib.c')
-rw-r--r--src/stdlib/stdlib.c2
1 files changed, 1 insertions, 1 deletions
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);