Skip to content
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

Unity 2022.3.4f1 NullReferenceException: Object reference not set to an instance of an object #43

Open
mdmm-git opened this issue Jul 11, 2023 · 7 comments

Comments

@mdmm-git
Copy link

public static class GUIHelper
{
private static readonly GUIStyle _closeButtonStyle = GUI.skin.FindStyle("ToolbarSeachCancelButton");

    [PublicAPI] public static bool CloseButton(Rect buttonRect)
    {
        return GUI.Button(buttonRect, GUIContent.none, _closeButtonStyle);
        //NullReferenceException: Object reference not set to an instance of an object
    }

}

@lorenblue
Copy link

Not sure what exactly this is referring to, but I will say that with Unity 2022 I get a stream of null reference exceptions as well, and this package is unusable.

@mdmm-git
Copy link
Author

mdmm-git commented Jul 30, 2023

Not sure what exactly this is referring to, but I will say that with Unity 2022 I get a stream of null reference exceptions as well, and this package is unusable.

Apparently newer versions of Unity are missing some of the styles used here. For example:

public static GUIStyle SearchToolbarStyle =>.
_searchToolbarStyle ?? (_searchToolbarStyle = new GUIStyle(GUI.skin.FindStyle("ToolbarSeachTextField"))));

@CuteRogue
Copy link

apparently unity change the style its typo one to fixed one (Seach to Search) based on this thread
https://forum.unity.com/threads/unable-to-use-input-system-panel.1450204/#post-9140920

@mdmm-git
Copy link
Author

mdmm-git commented Aug 3, 2023

apparently unity change the style its typo one to fixed one (Seach to Search) based on this thread https://forum.unity.com/threads/unable-to-use-input-system-panel.1450204/#post-9140920

Thanks! I didn't notice the typo, as Rider doesn't have highlighting for packages integrated via Package Manager -> Git. I'll upload a fork with the fix.

@nehvaleem
Copy link

happening to me too. its easily fixable using the custom package, but it isn't the point of maintained packages I think.

@LoupAndSnoop
Copy link

LoupAndSnoop commented Jan 9, 2024

Just to help anyone also struggling with this, it is only a problem if you have >10 types being searched, because that makes SolidAlloy use the extended search bar. Workaround:
ProjectSettings > Packages > TypeReferences > Search bar minimum items count. Change that from 10 to 99999, and it will stop trying to bring up the SolidAlloy search bar (which I believe just references broken Unity scripts...).

@mushakushi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants