Closed ascholerChemeketa closed 4 months ago
Nice catch! Had not thought that through.
I've spent a long time on this one. Mostly because there is an existing test on the return value being an empty string.
I agree with everything you have said. But I think I want to keep this function true to what it says it does - the publisher variable may indeed be an empty string, and in XSL-land that is frequently used for the same sorts of things None
is. (And this is not simply to avoid changes to behavior or employment.) So I have addressed the bug, by returning an empty string.
I've kept your name on this - I hope that is OK.
If a pub variable results in an empty string the get_publisher_varaible function chokes.
This provides
None
for missing values. Defaulting to""
might require less code for handling but also be more likely to result in sneaky errors based on assuming a non-empty string came back.