diff --git a/src/ef/Commands/DbContextOptimizeCommand.cs b/src/ef/Commands/DbContextOptimizeCommand.cs index 9bb7a18ee58..48eb6e5c038 100644 --- a/src/ef/Commands/DbContextOptimizeCommand.cs +++ b/src/ef/Commands/DbContextOptimizeCommand.cs @@ -53,7 +53,10 @@ protected override int Execute(string[] args) _precompileQueries!.HasValue(), _nativeAot!.HasValue()); - ReportResults(result); + if (result != null) + { + ReportResults(result); + } return base.Execute(args); }