Page 1 of 1
Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Mon Sep 28, 2020 5:26 pm
by JeanBis
Hi tony,
I have a strange problem and I don't quite understand the cause of this.
The error appear when a response window should appear, but this appen only in a build, in the editor everything work just fine.
The error is here [AbstractDialogueUI.cs Line: 304]
At that point in the script, every possible null reference exception is handled by the try/catch block, so what is null? and why this error only appears in build?
Thanks for your time
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Mon Sep 28, 2020 8:53 pm
by Tony Li
Hi,
Can you please provide more information?
You could also try commenting out the try...catch code so the NullReferenceException won't be caught and ignored. This may help you pinpoint the exact location of the error.
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 7:23 am
by JeanBis
Ok fixed!
commenting out those lines moved the error to [StandardUIMenuPanel.cs Line:457].
Something with template button navigation causes the error, so I set to false the bool "ExplicitNavigationForTemplateButtons" in "StandardUIMenuPanel" and everything works fine, now i have to set the buttons manually, but that's ok.
Thank you very much
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 8:43 am
by Tony Li
Hi,
What version of the Dialogue System are you using?
(Menu item Tools > Pixel Crushers > Dialogue System > Welcome Window, or look in _README.txt.)
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 9:09 am
by JeanBis
The latest version, 2.2.11
However the problem occurred also in a previous version, I don't remember which one, I updated yesterday in the hope that it would solve itself.
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 10:08 am
by Tony Li
Hi,
Does your template button have a Unity UI Button component?
In any case, this patch provides some extra checking that may resolve the issue:
DS_MenuPanelPatch_2020-09-29.unitypackage
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 11:24 am
by JeanBis
Hi tony,
I figure out what caused the error, in my button template, somehow, I lost the reference to the unity Button in the StandardUIResponseButton component.
Even if StandardUIResponseButton check the presence of the Button component in Awake and assign it automatically, in some way in the build, the variable is null, maybe because the gameobject is disabled from the start until is being used.
Now everything work as expected, thank you very much for your time and your patch
Re: Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
Posted: Tue Sep 29, 2020 11:39 am
by Tony Li
Glad to help!