Superfreak3
Member
- Joined
- Oct 10, 2019
- Messages
- 5
- Programming Experience
- 3-5
Hi all,
I'm getting the object reference not set to an instance of an object error in teh following code...
I think its blowing up at the highlighted code and may have something to do with Int32.Parse. ??
I had a troubleshooting message right after that code and it never reached it. The port is coming into the function as a string, as you can see.
Any idea what is wrong here? This is code from a widget where we haven't seen this issue yet so it was working. Scratching my head.
Any help or points to what else I could look at/for would be greatly appreciated!!
THANKS!!!!
I'm getting the object reference not set to an instance of an object error in teh following code...
C#:
private void AddRewriteRule(string port, string avPort, string ruleName, string ruleUrlMatch)
{
using (ServerManager serverManager = new ServerManager())
{
Site site = serverManager.Sites.FirstOrDefault(s => s.Bindings.ElementAt(0).EndPoint.Port == Int32.Parse(port));
string siteName = site.Name;
I think its blowing up at the highlighted code and may have something to do with Int32.Parse. ??
I had a troubleshooting message right after that code and it never reached it. The port is coming into the function as a string, as you can see.
Any idea what is wrong here? This is code from a widget where we haven't seen this issue yet so it was working. Scratching my head.
Any help or points to what else I could look at/for would be greatly appreciated!!
THANKS!!!!
Last edited by a moderator: