comparison: fix a NULL dereference