Edge Case Bug With DialogueActor.actor being null

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Sapidus3
Posts: 6
Joined: Fri Sep 10, 2021 2:31 pm

Edge Case Bug With DialogueActor.actor being null

Post by Sapidus3 »

Perhaps not exactly a bug, but it does not seem like appropriate behavior.

If the actor variable of DialogueActor is null (not just empty) it will eventually cause an error in DialogueDatabase.GetActor() (it doesn't work as a key-value).

Ordinarily, I would not bother mentioning this, except for the fact that the code explicitly checks if the string is null or empty as opposed to just null, so it seems as if a null string should be valid (that and there seems to be a lot of other "safety" checks throughout.

Also, not necessarily a bug, but annoying. SetupBarkUI() is the ONLY private method in DialogueActor (it also happened to be the one method that I wanted to use in a child class).

None of this is a big deal for my personal use case, as I was able to deal with it just fine once I identified the issue.

(In case you are curious, I was/am adding DialogueActor components via another script to do some stuff with barks. Unfortunately, OnAwake is called immediately before I could assign the BarkUI prefab, and apparently adding a component this way initializes strings as null as opposed to empty.)

Again, I'm good, just wanted to let you know about this.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Edge Case Bug With DialogueActor.actor being null

Post by Tony Li »

Hi,

Thanks for reporting those cases. I'll address them in v2.2.21 so others in the future don't have to work around them. (Actor variable null, SetupBarkUI protected virtual)
Post Reply