encodeNode should do the check