fix issue where edges could be deleted but it'd throw a NetworkXError in the process