Raise error if input is empty
Use 'when' instead of 'if'

This is the only case there is no else part.
Bump version and update Changes