Previously, edge attribute is generated based on whether colnames(edges_df)[j] is in selected attributes and the content for current edge edges_df[i, j] is valid.
The checks on edges_df[i, j] is whether it is NA or not empty string. But this logic is not closed since edges_df[i, j] can be empty string (''). This is possible since in previous code in generate_dot(), empty attributes have been set to empty string, not NA. This will lead to some bad behavior:
If the 1st edge does not have attributes set, this function will throw a "object 'attribute' not found" error. #440
If the previous edge has some attributes set while latters don't, then the previous attributes will be carried over to latter edges since attribute is not properly set to NULL at the beginning for each edge. e.g.
Previously, edge attribute is generated based on whether
colnames(edges_df)[j]
is in selected attributes and the content for current edgeedges_df[i, j]
is valid.The checks on
edges_df[i, j]
is whether it isNA
or not empty string. But this logic is not closed sinceedges_df[i, j]
can be empty string (''). This is possible since in previous code ingenerate_dot()
, empty attributes have been set to empty string, not NA. This will lead to some bad behavior:If the 1st edge does not have attributes set, this function will throw a "object 'attribute' not found" error. #440
If the previous edge has some attributes set while latters don't, then the previous attributes will be carried over to latter edges since
attribute
is not properly set toNULL
at the beginning for each edge. e.g.This patch adds a new check for
edges_df[i, j]
being empty string to fix this loop hole.