[[ Bugfix 12971 ]] Check for errors *before* trying to type-convert the ...

...result