Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Network: Handle null data gracefully #3571

Merged
merged 2 commits into from
Oct 14, 2017
Merged

Conversation

wimrijnders
Copy link
Contributor

During testing I discovered that passing null for network data leads to a thrown error.
This adds a guard to prevent it, plus unit tests for regression.

Fixes almende#3532

If the images option is set, preload it, even if the node shape is not `image` or `circularImage`.
This needs to be done because the user can switch to an image shape later, as is happening in the issue.
Option `image` is only mandatory for the image shapes.

There is no unit test for this, because it would need a mock object for Image and I didn't succeed in creating/finding one.
During testing I discovered that passing `null` for network data leads to a thrown error.
This adds a guard to prevent it, plus unit tests for regression.
@wimrijnders
Copy link
Contributor Author

Crap, I accidentally added a change for #3570 here. I hope it's OK, it shouldn't affect the outcome.

@yotamberk yotamberk merged commit 1ece237 into almende:develop Oct 14, 2017
@wimrijnders wimrijnders deleted the nullData branch October 14, 2017 07:47
mojoaxel pushed a commit to visjs/vis_original that referenced this pull request Jun 9, 2019
* Network: preload images in options for all shape types

Fixes almende#3532

If the images option is set, preload it, even if the node shape is not `image` or `circularImage`.
This needs to be done because the user can switch to an image shape later, as is happening in the issue.
Option `image` is only mandatory for the image shapes.

There is no unit test for this, because it would need a mock object for Image and I didn't succeed in creating/finding one.

* Network: Handle null data gracefully

During testing I discovered that passing `null` for network data leads to a thrown error.
This adds a guard to prevent it, plus unit tests for regression.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants