Often one finds that a variable that should have acquired a certain value has not yet done so. Or a condition depends upon a value that has been erroneously set.
A useful ploy to help you see these kinds of problems is to use something like -99 as your default value, which is unlikely to occur normally in your pie. Then if you see -99 in your running pie, you can much more quickly see what is going on.
Likewise, especially when getting text from an API, or by string manipulation, having “” as. the default text value for a variable is easily overlooked as a problem. Using “Null” as your default value – which will again not be likely to occur in your pie anywhere else will help you distinguish between something not having been done and having been done with an empty string.