mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 09:18:05 -04:00
Explicit null checks to avoid it trickling down into code where it's harder to tell.
This commit is contained in:
parent
422592d84e
commit
9a3fd0feb2
@ -72,6 +72,9 @@ private class Network private(private val data: mutable.Map[String, Network.Vert
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
def connect(nodeA: MutableNode, nodeB: MutableNode) = {
|
||||
if (nodeA == null) throw new NullPointerException("nodeA")
|
||||
if (nodeB == null) throw new NullPointerException("nodeB")
|
||||
|
||||
if (nodeA == nodeB) throw new IllegalArgumentException(
|
||||
"Cannot connect a node to itself.")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user