Fix calling charAt on undefined in previous patch

Issue #1203