Don't crash if stable doesn't exist
This commit is contained in:
parent
2a29984950
commit
8688a9ea7d
|
@ -15,4 +15,7 @@ Installers/dotNet/packages/
|
|||
Installers/dotNet/dlls/
|
||||
v2/dist/vendor/
|
||||
v2/lib/static.js
|
||||
**/*.suo
|
||||
**/*.suo
|
||||
Installers/**/*/bin
|
||||
Installers/**/*/obj
|
||||
Installers/**/*/packages
|
|
@ -42,14 +42,14 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="asardotnetasync">
|
||||
<HintPath>..\..\..\..\..\..\Projects\C#\asardotnetasync\asardotnetasync\bin\Release\asardotnetasync.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\Projects\C#\asardotnetasync\asardotnetasync\bin\Release\asardotnetasync.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\..\..\..\libs\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\libs\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
|
|
@ -73,6 +73,7 @@ namespace BetterDiscordWI.panels {
|
|||
|
||||
private void LocateDiscord() {
|
||||
var finalPath = GetLatestVersion(cbPtb.Checked ? PtbPath : cbCanary.Checked ? CanaryPath : StablePath);
|
||||
if (finalPath == string.Empty) finalPath = "Not found!";
|
||||
|
||||
tbPath.Text = finalPath;
|
||||
_formMain.DiscordPath = finalPath;
|
||||
|
@ -85,6 +86,7 @@ namespace BetterDiscordWI.panels {
|
|||
|
||||
private string GetLatestVersion(string path) {
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
if (dirs.Length <= 0) return string.Empty;
|
||||
var latest = dirs[0];
|
||||
|
||||
foreach (var dir in dirs) {
|
||||
|
|
Loading…
Reference in New Issue