Fix JSON decoding in case no text is returned

Reported by @astiam