From 51a3522ee7e595770111eebce31053a18fe2af2a Mon Sep 17 00:00:00 2001 From: "aricloverGitHub (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Tue, 17 Dec 2024 21:25:46 -0600 Subject: [PATCH] Update uYouPlusSettings.xm --- Sources/uYouPlusSettings.xm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index aa04bfa..34d3141 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -250,8 +250,10 @@ extern NSBundle *uYouPlusBundle(); // Import Settings functionality UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeImport]; documentPicker.allowsMultipleSelection = NO; + __weak typeof(self) weakSelf = self; documentPicker.didPickDocumentHandler = ^(NSArray * _Nonnull urls) { - if (urls.count > 0) { + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf && urls.count > 0) { NSURL *url = urls.firstObject; NSError *error = nil; NSString *settingsString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];