Rather then indenting such a large block, just throw the error instead right away rather then in the else clause. Always fail first.
Ex: if (!value->IsObject()) { return; }