Reputation: 159
I keep getting this error even tho the strings that i want to call to a function aren't null
(As you can see in pic the string isn't null)
This is the error
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
I even added some code to "handle", I mean to see if the strings are null, and they aren't but still it shows the error
if (opp1name != null && opp2name != null && opp3name != null)
This may be useful too?
Upvotes: 1
Views: 9571
Reputation: 564403
This could also occur if pl
is null
, or if something required within the pl.Send
method (aside from the passed arguments) is null
.
Make sure to properly instantiate pl
(so it is not null), as this is the most likely cause of the issue.
Upvotes: 12