Skip to content

Commit 21ecfd2

Browse files
committed
fix(api): ensure Address is parsed correctly when no Command is provided
Corrects a bug in MigInterfaceCommand `BuildRequest` where the Address segment (requests[1]) was not being assigned if the request only contained two segments (Domain/Address), causing premature function exit. - Address is now correctly parsed as requests[1] when requests.Length > 1.
1 parent bbca0c8 commit 21ecfd2

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

MIG/MigInterfaceCommand.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,15 @@ private void BuildRequest(string request, object data = null)
8181
if (requests.Length > 1)
8282
{
8383
Domain = requests[0];
84-
if (Domain == "html")
84+
Address = requests[1];
85+
if (requests.Length > 2)
8586
{
86-
return;
87+
Command = requests[2];
8788
}
88-
else if (requests.Length > 2)
89+
if (requests.Length > 3)
8990
{
90-
Address = requests[1];
91-
Command = requests[2];
92-
if (requests.Length > 3)
93-
{
94-
options = new string[requests.Length - 3];
95-
Array.Copy(requests, 3, options, 0, requests.Length - 3);
96-
}
91+
options = new string[requests.Length - 3];
92+
Array.Copy(requests, 3, options, 0, requests.Length - 3);
9793
}
9894
}
9995
}
@@ -105,4 +101,3 @@ private void BuildRequest(string request, object data = null)
105101

106102
}
107103
}
108-

0 commit comments

Comments
 (0)