Skip to content

Commit

Permalink
Merge pull request #66 from Meivyn/fix/null-ref
Browse files Browse the repository at this point in the history
Fix exception on exit
  • Loading branch information
rithik-b authored Nov 17, 2023
2 parents 4545bff + 9795a64 commit a9e6b21
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions PlaylistManager/UI/ViewControllers/FoldersViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a9e6b21

Please sign in to comment.