Simplify the construct for guarding against empty output string.