Passing nil as a parameter in place of a TComponent
I've come across some code that's throwing an exception (EIntfCasterror Cast not supported) when it passes nil to a constructor expecting a TComponent, like so:

    SomeObject obj := SomeClass(nil);

The unit this is in does not contain a form and even TForm requires a TComponent be passed to it when you call its constructor.  What should I pass in place of nil if anything exists or is there a way to get it to accept nil.

Thank you.

Also, I don't have the source code which calls the method this is in, or I would just have it pass the form it has access to.
Passing nil as a parameter in place of a TComponent
===

I've come across some code that's throwing an exception (EIntfCasterror Cast not supported) when it passes nil to a constructor expecting a TComponent, like so:

    SomeObject obj := SomeClass(nil);

The unit this is in does not contain a form and even TForm requires a TComponent be passed to it when you call its constructor.  What should I pass in place of nil if anything exists or is there a way to get it to accept nil.

Thank you.

Also, I don't have the source code which calls the method this is in, or I would just have it pass the form it has access to.