From a386e7c95eb6605878879e37405ba1aed94ab953 Mon Sep 17 00:00:00 2001 From: LazuliKao Date: Tue, 2 May 2023 14:15:49 +0800 Subject: [PATCH] fix crash on delete working dir --- src/LipUI/Global.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/LipUI/Global.cs b/src/LipUI/Global.cs index 18b4572..3786cef 100644 --- a/src/LipUI/Global.cs +++ b/src/LipUI/Global.cs @@ -412,10 +412,9 @@ void Save() void CollectionChangeHandler(object sender, NotifyCollectionChangedEventArgs e) { Save(); - foreach (var item in e.NewItems) - { - Subscribe(item); - } + if (e.NewItems is not null) + foreach (var item in e.NewItems) + Subscribe(item); } void Subscribe(object? sub) {