NullReferenceException: Object reference not set to an instance of an object
Closed this issue · 0 comments
starikcetin commented
I get this exception after pressing "Take Screenshots":
NullReferenceException: Object reference not set to an instance of an object
Borodar.ScreenShooter.Utils.GameViewUtil.AddCustomSize (Borodar.ScreenShooter.Utils.GameViewUtil+GameViewSizeType viewSizeType, UnityEditor.GameViewSizeGroupType sizeGroupType, System.Int32 width, System.Int32 height, System.String text) (at Assets/Plugins/Screen Shooter/Screen-Shooter/ScreenShooter/Editor/Scripts/Util/GameViewUtil.cs:66)
Borodar.ScreenShooter.ScreenShooterWindow+<TakeScreenshots>c__Iterator0.MoveNext () (at Assets/Plugins/Screen Shooter/Screen-Shooter/ScreenShooter/Editor/Scripts/ScreenShooterWindow.cs:224)
Borodar.ScreenShooter.Utils.EditorCoroutine.Update () (at Assets/Plugins/Screen Shooter/Screen-Shooter/ScreenShooter/Editor/Scripts/Util/EditorCoroutine.cs:61)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)
After some digging through, I discovered that the ctor
variable at the line 65 of GameViewUtil.cs
is not fetching the constructor, but remains null, therefore the line beneath it fails because of null reference.
Simply getting all constructors and invoking the 0th one works since there are no other constructors in the target file. But this feels very hacky, since they can change this implementation in the future. Nevertheless, I will send you a pull request about this, the decision is yours.
I am using Unity 2017.3.1f1