diff --git a/src/runtime/printer.h b/src/runtime/printer.h index 5512cf9de552..c1005c2ee6ca 100644 --- a/src/runtime/printer.h +++ b/src/runtime/printer.h @@ -44,7 +44,12 @@ class Printer { } Printer &operator<<(const char *arg) { - dst = halide_string_to_string(dst, end, arg); + // Crashing on NULL here is a big debugging time sink. + if (arg == NULL) { + dst = halide_string_to_string(dst, end, ""); + } else { + dst = halide_string_to_string(dst, end, arg); + } return *this; }