From 9795a6466e1063047156d9d9b4f601beb6cdc16b Mon Sep 17 00:00:00 2001 From: Meivyn <793322+Meivyn@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:48:06 -0500 Subject: [PATCH] Fix exception on exit --- .../UI/ViewControllers/FoldersViewController.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/PlaylistManager/UI/ViewControllers/FoldersViewController.cs b/PlaylistManager/UI/ViewControllers/FoldersViewController.cs index 46416cc..8c263ea 100644 --- a/PlaylistManager/UI/ViewControllers/FoldersViewController.cs +++ b/PlaylistManager/UI/ViewControllers/FoldersViewController.cs @@ -291,7 +291,11 @@ private void CreateFolder() private void CreateKeyboardEnter(string folderName) { - if (CurrentParentManager == null) return; + if (CurrentParentManager == null) + { + return; + } + folderName = folderName.Replace("/", "").Replace("\\", "").Replace(".", ""); if (!string.IsNullOrEmpty(folderName)) { @@ -324,7 +328,11 @@ private void RenameButtonClicked() private void RenameKeyboardEnter(string folderName) { - if (CurrentParentManager?.Parent == null) return; + if (CurrentParentManager?.Parent == null) + { + return; + } + folderName = folderName.Replace("/", "").Replace("\\", "").Replace(".", ""); if (!string.IsNullOrEmpty(folderName)) { @@ -356,6 +364,11 @@ private void DeleteConfirm() public void LevelCategoryUpdated(SelectLevelCategoryViewController.LevelCategory levelCategory, bool viewControllerActivated) { + if (rootTransform == null) + { + return; + } + if (levelCategory == SelectLevelCategoryViewController.LevelCategory.CustomSongs) { rootTransform.gameObject.SetActive(true);