Merge: if both inputs are not connected, throw an exception.