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|