diff --git a/ECMJobRunner.Application/Profiles/Commands/Behaviors/MainQueryExecutionBehavior.cs b/ECMJobRunner.Application/Profiles/Commands/Behaviors/MainQueryExecutionBehavior.cs index d7644f1..3570657 100644 --- a/ECMJobRunner.Application/Profiles/Commands/Behaviors/MainQueryExecutionBehavior.cs +++ b/ECMJobRunner.Application/Profiles/Commands/Behaviors/MainQueryExecutionBehavior.cs @@ -78,13 +78,13 @@ namespace ECMJobRunner.Application.Profiles.Commands.Behaviors reason: "Main Query returned nothing.", query: sqlMainQuery, innerException: null); - else if (result.ReturnValue is not null || result.ReturnValue != 0) + else if (result.ReturnValue is not null && result.ReturnValue != 0) throw new JobSqlException( profileId: command.Job.ProfileId, jobName: "Triggering DEX", processName: "Main Query", batchId: command.BatchId, - reason: $"The query unexpectedly returned the value {result.ReturnValue}. The expected value was null.", + reason: $"The query unexpectedly returned the value {result.ReturnValue}. The expected value was null or 0.", query: sqlMainQuery, innerException: null); } }