From f3d36a6627e4d4e869f421c70176b8092dba9bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 10 Nov 2020 18:22:02 +0100 Subject: [PATCH] Fix Command#report_warnings to gracefully handle missing Compiler#program (#9866) --- src/compiler/crystal/semantic/warnings.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/crystal/semantic/warnings.cr b/src/compiler/crystal/semantic/warnings.cr index 48fa1b504ef8..5516c605bb45 100644 --- a/src/compiler/crystal/semantic/warnings.cr +++ b/src/compiler/crystal/semantic/warnings.cr @@ -169,7 +169,8 @@ module Crystal compiler = @compiler return unless compiler - program = compiler.program + program = compiler.program? + return unless program return if program.warning_failures.empty? program.warning_failures.each do |message|