-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullReferenceException on Unity 2019.4.1 #30
Comments
The closest setup I have is Unity 2019.4.0f1 on Windows and I can't reproduce this issue with these reproduction steps. And frankly, it should be impossible to encounter this Issue. Let's see why:
which is inside here:
Awake is called before any other functions. If there was an exception that interrupted Awake, this error would be possible but you didn't mention any in the Issue description. Are there any other steps that you didn't mention in Reproduction steps? You should create a new Unity project, import the plugin there and take note of every step you take until you can reproduce this issue and report all of these steps in Reproduction steps. |
I'm finding the same error with version 1.4.1, running in Unity 2020.2.1f1 on Windows 10. @yasirkula from what you say, it makes sense that it happens, because during the start of my scene, I don't invoke any file browser, so the Awake method doesn't have a chance to run. But somehow Unity itself is invoking something that runs I already have an EventSystem in my scene, so I disabled the EventSystem gameobject inside SimpleFileBrowserCanvas. I didn't try it in an empty scene without an existing EventSystem... could that be it? The already-existing EventSystem is triggering the toggle changed event? |
I restarted Unity and now I can't reproduce the bug anymore... I'm not sure what fixed it, because I didn't change anything in my setup. Maybe it was because I imported a new version of Runtime File Browser without deleting all the files from the previous one. |
I don't think it is related to EventSystem. Do you have an instance of SimpleFileBrowserCanvas object in your scene? If so, is it active? Did you modify it in any way? |
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. 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:
I must've had the prefab mode open yesterday and didn't realize it. |
Awesome! I was able to reproduce the error on 2018.4, too. |
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
Platform specs
Please provide the following info if this is a Unity 3D repository.
Additional info
Please check Logcat (Android) or Xcode console (iOS) for any meaningful error messages and include them here.
The text was updated successfully, but these errors were encountered: