Edge Case Bug With DialogueActor.actor being null
Posted: Wed Sep 15, 2021 12:13 am
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.
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.