yasirkula / UnityIngameDebugConsole

A uGUI based console to see debug messages and execute commands during gameplay in Unity
MIT License
2.11k stars 221 forks source link

Null Ref with enableSearchbar = false #33

Closed ddutchie closed 3 years ago

ddutchie commented 3 years ago

Description of the bug

In DebugLogManager when enableSeachbar= false there is a null reference.

Its due to

if (!enableSearchbar) { //This is set to null. searchbar = null; searchbarSlotTop.gameObject.SetActive(false); searchbarSlotBottom.gameObject.SetActive(false); }

a few lines later

searchbar.GetComponent<InputField>().onValueChanged.AddListener(SearchTermChanged);

is then null as you cleared the reference.

yasirkula commented 3 years ago

You are right. I must've moved AddListener line downwards in a recent update without thinking about the consequences. Will fix the issue ASAP.