private int getDegreeSafe ( Node node , RelationshipType relType , Direction direction ) { if ( relType == null ) { return node . getDegree ( direction ) ; } return node . getDegree ( relType , direction ) ; }
works in cases when relType is null