Skip to content

Commit b33f19a

Browse files
committed
minor various cleanup
1 parent a9217e4 commit b33f19a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

FlashpointSecurePlayer/EnvironmentVariables.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ private string GetValue(EnvironmentVariablesElement environmentVariablesElement)
5656
throw new InvalidEnvironmentVariablesException("Failed to get the \"" + environmentVariablesElement.Name + "\" Environment Variable.");
5757
}
5858

59+
if (value == null) {
60+
return value;
61+
}
62+
5963
Regex regex = null;
6064

6165
try {
@@ -71,8 +75,7 @@ private string GetValue(EnvironmentVariablesElement environmentVariablesElement)
7175
LogExceptionToLauncher(ex);
7276
throw new InvalidEnvironmentVariablesException("The Regex Match timed out.");
7377
} catch (Exception ex) {
74-
// value was not defined
75-
// fail silently
78+
// match failed?
7679
LogExceptionToLauncher(ex);
7780
}
7881
return value;

FlashpointSecurePlayer/FlashpointSecurePlayerGUI.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,9 @@ private void FlashpointSecurePlayer_Load(object sender, EventArgs e) {
13501350
}
13511351

13521352
if (ModificationsRevertMethod == MODIFICATIONS_REVERT_METHOD.DELETE_ALL) {
1353-
if (MessageBox.Show(Properties.Resources.ForceDeleteAllWarning, Properties.Resources.FlashpointSecurePlayer, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) {
1353+
DialogResult dialogResult = MessageBox.Show(Properties.Resources.ForceDeleteAllWarning, Properties.Resources.FlashpointSecurePlayer, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
1354+
1355+
if (dialogResult == DialogResult.No) {
13541356
ModificationsRevertMethod = MODIFICATIONS_REVERT_METHOD.CRASH_RECOVERY;
13551357
Application.Exit();
13561358
return;

FlashpointSecurePlayer/Shared.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,9 @@ public static bool TestInternetURI(Uri uri) {
20752075

20762076
// the URI Scheme is always lowercase
20772077
string scheme = uri.Scheme;
2078-
return scheme == URI_SCHEME_HTTP || scheme == URI_SCHEME_HTTPS || scheme == URI_SCHEME_FTP;
2078+
return scheme.Equals(URI_SCHEME_HTTP, StringComparison.Ordinal)
2079+
|| scheme.Equals(URI_SCHEME_HTTPS, StringComparison.Ordinal)
2080+
|| scheme.Equals(URI_SCHEME_FTP, StringComparison.Ordinal);
20792081
}
20802082

20812083
/*
@@ -2089,7 +2091,7 @@ public static StringBuilder GetWindowsVersionName(bool edition = false, bool ser
20892091
versionName.Append("95");
20902092
break;
20912093
case 10:
2092-
if (operatingSystem.Version.Revision.ToString() == "2222A") {
2094+
if (operatingSystem.Version.Revision.ToString().Equals("2222A", StringComparison.Ordinal)) {
20932095
versionName.Append("98 SE");
20942096
} else {
20952097
versionName.Append("98");

0 commit comments

Comments
 (0)