fixed up non-None return on empty nodes/edges list