question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException on Unity 2019.4.1

See original GitHub issue

Description of the bug

NullReferenceException: Object reference not set to an instance of an object SimpleFileBrowser.RecycledListView.UpdateList () (at Assets/Plugins/SimpleFileBrowser/Scripts/SimpleRecycledListView/RecycledListView.cs:55) SimpleFileBrowser.FileBrowser.RefreshFiles (System.Boolean pathChanged) (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1420) SimpleFileBrowser.FileBrowser.OnShowHiddenFilesToggleChanged () (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1071) UnityEngine.Events.InvokableCall.Invoke () (at <4eca0aa85b9643a199169bb7e91fc8d3>:0) UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <4eca0aa85b9643a199169bb7e91fc8d3>:0) UnityEngine.UI.Toggle.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:130) UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:177) UnityEngine.UI.ScrollRect:LateUpdate() (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/ScrollRect.cs:805)

Reproduction steps

FileBrowser.ShowLoadDialog((paths => {
                //todo
}), () => {
                //todo
});

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 2019.4.1
  • Platform: Windows
  • How did you download the plugin: Asset Store version 1.3.6

Additional info

Please check Logcat (Android) or Xcode console (iOS) for any meaningful error messages and include them here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
artur-agcommented, Jan 13, 2021

Not during the start of the scene, no, it gets created when I invoke the file browser by clicking on a UI button in my own Canvas. ~But when I was getting the error yesterday, I can’t remember if the SimpleFileBrowserCanvas object was there from the beginning or not, and now I can’t reproduce the exception.~

I did two changes in the SimpleFileBrowserCanvas: I disabled the EventSystem, because I already have one in my scene, and changed the CanvasScaler reference resolution.

EDIT: I managed to reproduce the bug!! It happened while I started the game in the editor while having the SimpleFileBrowserCanvas prefab opened in Prefab mode. Here are the steps to reproduce it in Unity 2020.2.1f1:

  1. Create an empty scene (I tried with my existing scene and with an empty one, and it happened both times).
  2. Double-click SimpleFileBrowserCanvas.prefab in the Project panel. This will open it in Prefab mode, and makes the scene panel background blue.
  3. With the prefab still open, press Play.
  4. The following exception occurs right after starting:
NullReferenceException: Object reference not set to an instance of an object
SimpleFileBrowser.RecycledListView.UpdateList () (at Assets/Plugins/SimpleFileBrowser/Scripts/SimpleRecycledListView/RecycledListView.cs:55)
SimpleFileBrowser.FileBrowser.RefreshFiles (System.Boolean pathChanged) (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1621)
SimpleFileBrowser.FileBrowser.OnShowHiddenFilesToggleChanged () (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1266)
UnityEngine.Events.InvokableCall.Invoke () (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.UI.Toggle.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:130)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:182)
UnityEngine.UI.ScrollRect:LateUpdate() (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/ScrollRect.cs:808)

I must’ve had the prefab mode open yesterday and didn’t realize it.

0reactions
yasirkulacommented, Jan 13, 2021

Awesome! I was able to reproduce the error on 2018.4, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >
Question - Unity Editor Null Reference Exception
When ever I try to use the animation window or play test my game inside of unity, this error appears and I don't...
Read more >
How to Solve NullReferenceException: UnityEngine.UI. ...
A null reference exception occurs when you try to access a instant of a object that doesn't exist, meaning that your likely trying...
Read more >
NullReferenceException when making a requests ...
I am using Unity 2019.4.0f1 and the latest version of the Playfab SDK (2.102.210111). Other requests seem to work except for these two...
Read more >
Null Reference Exception Error - Dropdown bar
I've just tried using Unity 2020.2.2f1 and everything worked fine. Could double check that you are indeed using UIS v1.1.4. Unity has been ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found