[#600] ensure the given parameter is valid before parsing it

That needs further debug to see why this is happening only with
Canvas+, but I do not have an android device (for debugging) now, and
can only cure the symptom and not the cause ….