Skip to content

Commit

Permalink
JobScheduler: NullReference when editing a job #1003
Browse files Browse the repository at this point in the history
  • Loading branch information
apobekiaris committed Jun 19, 2023
1 parent 1a59371 commit c1e92dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/Modules/JobScheduler.Hangfire/BusinessObjects/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class Job:CustomBaseObject {
[Browsable(false)]
public IList<ObjectString> JobMethods
=> AppDomain.CurrentDomain.JobMethods().Where(info => info.DeclaringType==JobType?.Type)
.Select(info => new ObjectString(info.Attribute<JobProviderAttribute>()?.DisplayName??info.Name.CompoundName() ))
.Select(info => new ObjectString(info.Name ){Caption = info.Attribute<JobProviderAttribute>()?.DisplayName??info.Name.CompoundName()})
.ToArray();

[Browsable(false)]
Expand All @@ -80,9 +80,6 @@ public IList<ObjectString> JobMethods
public override void AfterConstruction() {
base.AfterConstruction();
_cronExpression=Session.Query<CronExpression>().FirstOrDefault(expression => expression.Name == nameof(Cron.Never));
_jobType = JobTypes.FirstOrDefault();
_jobMethod = JobMethods.FirstOrDefault();
Id = Guid.NewGuid().ToString();
}

CronExpression _cronExpression;
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/TestsLib.Common/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Linq;
using System.Linq.Expressions;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Threading;
Expand Down Expand Up @@ -39,6 +38,7 @@
using Xpand.Extensions.Reactive.Filter;
using Xpand.Extensions.Reactive.Transform;
using Xpand.Extensions.Reactive.Utility;
using Xpand.Extensions.StringExtensions;
using Xpand.Extensions.XAF.ActionExtensions;
using Xpand.Extensions.XAF.ModelExtensions;
using Xpand.Extensions.XAF.ViewExtensions;
Expand Down Expand Up @@ -384,7 +384,7 @@ public static XafApplication NewXafApplication<TModule>(this Platform platform,
throw new NotSupportedException(
"if implemented make sure all tests pass with TestExplorer and live testing");
}
application.Title = TestContext.CurrentContext.Test.FullName.Truncate(255);
application.Title = TestContext.CurrentContext.Test.FullName.CleanCodeName().Truncate(255);

return application;
}
Expand Down

0 comments on commit c1e92dc

Please sign in to comment.