Skip to content

Commit 411327b

Browse files
committed
use a constant for minimum args length
1 parent 11b7ab3 commit 411327b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

FlashpointSecurePlayer/FlashpointSecurePlayerGUI.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,19 +1278,22 @@ private void FlashpointSecurePlayer_Load(object sender, EventArgs e) {
12781278
// fail silently
12791279
}
12801280

1281+
const int MIN_ARGS_LENGTH = 3;
1282+
12811283
// Get Arguments
12821284
string[] args = Environment.GetCommandLineArgs();
12831285

12841286
// throw on load
1285-
if (args.Length < 3) {
1287+
if (args.Length < MIN_ARGS_LENGTH) {
12861288
throw new InvalidTemplateException("The Template Name and URL are required.");
12871289
}
12881290

12891291
TemplateName = args[1];
12901292
URL = args[2];
1293+
12911294
string arg = null;
12921295

1293-
for (int i = 3; i < args.Length; i++) {
1296+
for (int i = MIN_ARGS_LENGTH; i < args.Length; i++) {
12941297
arg = args[i].ToLowerInvariant();
12951298

12961299
// instead of switch I use else if because C# is too lame for multiple case statements

0 commit comments

Comments
 (0)