From 75cd46aded234208bee46381a65b9d835b14a39d Mon Sep 17 00:00:00 2001 From: schochastics Date: Wed, 25 Jun 2025 22:22:01 +0200 Subject: [PATCH] added check for vertex type attr --- R/bipartite.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/bipartite.R b/R/bipartite.R index 25b72d5220e..4c2cc669615 100644 --- a/R/bipartite.R +++ b/R/bipartite.R @@ -198,10 +198,10 @@ bipartite_projection <- function( which ) if (remove.type) { - if (is_igraph(res[[1]])) { + if (is_igraph(res[[1]]) && "type" %in% vertex_attr_names(res[[1]])) { res[[1]] <- delete_vertex_attr(res[[1]], "type") } - if (is_igraph(res[[2]])) { + if (is_igraph(res[[2]]) && "type" %in% vertex_attr_names(res[[2]])) { res[[2]] <- delete_vertex_attr(res[[2]], "type") } }