Skip to content

Commit

Permalink
fix: 修复在删除临时层课表的源课表后应用崩溃的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Sep 30, 2024
1 parent 59591f1 commit 992aade
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ values[2] is not ObservableDictionary<string, Subject> subjects ||
return null;
}

// FIXME: 这些代码应该迁移到其它地方,不适合在此处此课程标记是否属于换课课程
if (classPlan.OverlaySourceId != null)
{
var overlaySource = IAppHost.GetService<IProfileService>().Profile.ClassPlans[classPlan.OverlaySourceId];
if (overlaySource.TimeLayout == classPlan.TimeLayout)
if (IAppHost.GetService<IProfileService>().Profile.ClassPlans
.TryGetValue(classPlan.OverlaySourceId, out var overlaySource)
&& overlaySource.TimeLayout == classPlan.TimeLayout)
{
classPlan.Classes[subjectIndex].IsChangedClass =
overlaySource.Classes[subjectIndex].SubjectId != classPlan.Classes[subjectIndex].SubjectId;
Expand Down

0 comments on commit 992aade

Please sign in to comment.