From cb7e2a738af86cc03e479958185503b21c7c70aa Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:32:22 +0000 Subject: [PATCH] Update HomeboundService.cs --- SecondBotEvents/Services/HomeboundService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SecondBotEvents/Services/HomeboundService.cs b/SecondBotEvents/Services/HomeboundService.cs index d1b31db..1476c12 100644 --- a/SecondBotEvents/Services/HomeboundService.cs +++ b/SecondBotEvents/Services/HomeboundService.cs @@ -332,20 +332,29 @@ namespace SecondBotEvents.Services public int x = 0; public int y = 0; public int z = 0; - public SimSlURL(string url) + public SimSlURL(string? url) { + if(url == null) + { + name = "null"; + x = 0; + y = 0; + z = 0; + return; + } // http://maps.secondlife.com/secondlife/Viserion/66/166/23 url = url.Replace("maps.secondlife.com/secondlife/", ""); url = url.Replace("http://", ""); url = url.Replace("https://", ""); // Viserion/66/166/23 string[] bits = url.Split("/"); - if(bits.Count() != 3) + if(bits.Count() != 4) { name = "null"; x = 0; y = 0; z = 0; + return; } name = System.Net.WebUtility.UrlDecode(bits[0]); x = int.Parse(bits[1]);