diff --git a/lib/infograph.js b/lib/infograph.js
index <HASH>..<HASH> 100644
--- a/lib/infograph.js
+++ b/lib/infograph.js
@@ -95,6 +95,9 @@ class InfoGraph {
 
 
   addEdge(fromId, toId) {
+    if (!fromId || !toId)
+      throw new Error(`Cannot add edge from ${fromId} to ${toId}`)
+
     const edges = this.adjacencyList[fromId] || new Set()
     edges.add(toId)
     this.adjacencyList[fromId] = edges
InfoGraph#addEdge: throws errors when information is missing