fix error when graph has no nodes

shouldn't really want to export empty graph, but still