Browse Source

replace try-catch-all with Guid.TryParse

pull/550/head
Siegfried Pammer 11 years ago
parent
commit
8ea39b77e6
  1. 15
      ILSpy/CommandLineArguments.cs

15
ILSpy/CommandLineArguments.cs

@ -53,15 +53,12 @@ namespace ICSharpCode.ILSpy @@ -53,15 +53,12 @@ namespace ICSharpCode.ILSpy
this.NoActivate = true;
else if (arg.StartsWith("/fixedGuid:", StringComparison.OrdinalIgnoreCase)) {
string guid = arg.Substring("/fixedGuid:".Length);
try {
if (guid.Length < 32)
guid = guid + new string('0', 32 - guid.Length);
this.FixedGuid = new Guid(guid);
} catch {
this.FixedGuid = null;
}
}
else if (arg.StartsWith("/saveDir:", StringComparison.OrdinalIgnoreCase))
if (guid.Length < 32)
guid = guid + new string('0', 32 - guid.Length);
Guid fixedGuid;
if (Guid.TryParse(guid, out fixedGuid))
this.FixedGuid = fixedGuid;
} else if (arg.StartsWith("/saveDir:", StringComparison.OrdinalIgnoreCase))
this.SaveDirectory = arg.Substring("/saveDir:".Length);
} else {
this.AssembliesToLoad.Add(arg);

Loading…
Cancel
Save