Why not just `if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {` instead?