Getting null pointer when trying to access edge.opposite.residual