Throw exception if input arguments are null