`JsonParseFile` will do it properly, so actually the `NULL==doc` check is redundant but not a big deal.