Make sure deviceNode exists before using it for comparisons