Input "" should return 1 instead of 0


The task is
Given an encoded message containing digits, determine the total number of ways to decode it.
So the input string MUST BE a valid encoded message. Otherwise the task could be formulated like this:
Given a string (containing digits), determine the total number of ways to decode it, or return 0 if it is not a valid encoded message.