From d932ef81526fa9c44c45f54146efc6dfcf98fca4 Mon Sep 17 00:00:00 2001 From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com> Date: Sat, 25 Mar 2023 10:00:01 +0700 Subject: [PATCH] Fix: crashes on opening launcher settings ingame Exception type: NSInvalidArgumentException Reason: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0] --- Natives/LauncherPreferencesViewController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Natives/LauncherPreferencesViewController.m b/Natives/LauncherPreferencesViewController.m index 69b5a4d1..9e34c76d 100644 --- a/Natives/LauncherPreferencesViewController.m +++ b/Natives/LauncherPreferencesViewController.m @@ -434,7 +434,9 @@ typedef void(^CreateView)(UITableViewCell *, NSString *, NSDictionary *); ]; self.title = localize(@"Settings", nil); - self.navigationItem.rightBarButtonItems = @[[sidebarViewController drawAccountButton], [self drawHelpButton]]; + if (self.navigationController) { + self.navigationItem.rightBarButtonItems = @[[sidebarViewController drawAccountButton], [self drawHelpButton]]; + } } - (UIBarButtonItem *)drawHelpButton {