Make getEdgeWeight throw NPE on null edge.