diff --git a/src/pike_types.c b/src/pike_types.c
index 3089192291b40602d6539e0483b96e9ac3d80c19..6ba33268b75afb3846259d6305777e3c6901f600 100644
--- a/src/pike_types.c
+++ b/src/pike_types.c
@@ -2822,7 +2822,13 @@ static int lower_or_pike_types(struct pike_type *t1,
     }
   }
   if (!elem_on_stack) {
-    push_finished_type(t);
+    if (t) {
+      push_finished_type(t);
+    } else {
+      push_type(T_ZERO);
+    }
+  } else if (!t) {
+    /* No need to do anything. */
   } else if ((top = peek_type_stack())->type != t->type) {
     if (zero_implied && (top->type == T_ZERO)) {
       Pike_compiler->type_stackp--;