fixed crash on invalid input followed by -i for texture packer command.

This commit is contained in:
Harrison Deng 2019-01-08 15:42:04 -06:00
parent 442ec92d32
commit 74a9ff74b2
2 changed files with 5 additions and 1 deletions

View File

@ -64,12 +64,17 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
if (input == "q") return;
if (input.Length == 0) break;
} while (!int.TryParse(input, out mp));
}
else
{
int indexOfInputArg = IndexOfArgumentIn("-i", arguments);
if (indexOfInputArg + 1 >= arguments.Length) throw new ArgumentException("-i is not followed by input path.");
path = arguments[1 + IndexOfArgumentIn("-i", arguments)];
int.TryParse(arguments[IndexOfArgumentIn("-mp", arguments) + 1], out mp);
int.TryParse(arguments[IndexOfArgumentIn("-sp", arguments) + 1], out sp);
int indexOfOutputArg = IndexOfArgumentIn("-o", arguments);
if (indexOfOutputArg + 1 >= arguments.Length) throw new ArgumentException("-o is not followed by input path.");
output = arguments[IndexOfArgumentIn("-o", arguments) + 1];
if (HasArgument("-dau", arguments)) dau = true;
}

View File

@ -89,7 +89,6 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\RecrownedAthenaeum.Pipeline\RecrownedAthenaeum.Pipeline.csproj">
<Project>{b38f9812-b1d1-4bfe-89ee-fc4dd4ebaa3f}</Project>