An ArgumentNullException is thrown when what is passed to a method is null.
Foo bar = null;
// If the method doesn't accept null it may throw an ArgumentNullException.
Method(bar);The parameter name listed in the error, and the stack trace, are both clues to what is null.
Be aware that extension methods can throw this exception when the object you invoke the method on is invalid or null.
Texture2D.EncodeToPNG(); will throw an exception if Texture2D is null.You can run methods on unity-null objects because they actually still exist. If the method doesn't implement internal checks as expected, this can manifest as an ArgumentNullException instead of a typical NullReferenceException.
AudioSource source = GetComponent<AudioSource>();
// If source was null it will throw an ArgumentNullException.
source.PlayOneShot(clip, 1);AudioSource.PlayOneShot() and AudioSource.Play() will throw an exception if AudioSource is null.Note that many errors from Unity Editor code can throw an ArgumentNullException, if the stack trace doesn't contain user code then it's likely not your issue, and Unity may just need to be restarted.
After understanding this page's content, visit NullReferenceException to further debug your issue.