Unity-Twitch-Chat icon indicating copy to clipboard operation
Unity-Twitch-Chat copied to clipboard

irc.JoinChannel() throws an exception

Open xThuby opened this issue 2 years ago • 0 comments

While playing around with this plugin I found that this exception gets thrown when trying to use irc.JoinChannel() I passed in a string with a valid twitch channel name.

NullReferenceException: Object reference not set to an instance of an object
Lexone.UnityTwitchChat.IRC.JoinChannel (System.String channel) (at ./Library/PackageCache/com.lexonegit.unity-twitch-chat@1645b38432/Runtime/IRC.cs:307)
PrepScreenManager.ConnectIRC () (at Assets/Scripts/UI/PrepScreenManager.cs:105)
UnityEngine.Events.InvokableCall.Invoke () (at <10871f9e312b442cb78b9b97db88fdcb>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <10871f9e312b442cb78b9b97db88fdcb>:0)
UnityEngine.UI.Button.Press () (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/Button.cs:70)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/Button.cs:114)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at ./Library/PackageCache/[email protected]/Runtime/EventSystem/ExecuteEvents.cs:57)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at ./Library/PackageCache/[email protected]/Runtime/EventSystem/ExecuteEvents.cs:272)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:1091)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMouseEvent(Int32, Int32) (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:992)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMouseEvents() (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:976)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:Process() (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:690)
UnityEngine.EventSystems.EventSystem:Update()
Rewired.Integration.UnityUI.RewiredEventSystem:Update() (at Assets/Rewired/Integration/UnityUI/RewiredEventSystem.cs:40)
    public void ConnectIRC()
    {
        // irc.channel = twitchChannelName;
        irc.JoinChannel(twitchChannelName);
        connectButton.interactable = false;
    }

This method gets called from a button press event using the Unity UI system. I am also using Rewired, which is why it's mentioned a lot in the exception. I don't know if Rewired has anything to do with this error, but I thought it was good to mention.

xThuby avatar Oct 30 '23 19:10 xThuby