Call JSON.parse only if there is a string