This is a personal preference but I tend to prefer raising an exception on invalid input like this, instead of returning an empty result, since I think it can provide a lot more detailed information about what went wrong.  Given a stack trace, the code and the input, it becomes a lot easier to figure out exactly what's wrong.