Fixed some exception

This commit is contained in:
Serraniel 2017-05-02 13:32:37 +02:00
parent cc1f9d4619
commit 548d10cda8
3 changed files with 19 additions and 4 deletions

View file

@ -56,7 +56,7 @@ namespace DML.Application
foreach (var job in Core.Scheduler.JobList)
{
lbxJobs.Items.Add(
$"{FindServerById(job.GuildId).Name}:{FindChannelById(FindServerById(job.GuildId), job.ChannelId).Name}");
$"{FindServerById(job.GuildId)?.Name}:{FindChannelById(FindServerById(job.GuildId), job.ChannelId)?.Name}");
}
lbxJobs.SelectedIndex = oldIndex;
}

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.148.0")]
[assembly: AssemblyFileVersion("0.2.148.0")]
[assembly: AssemblyVersion("0.99.148.0")]
[assembly: AssemblyFileVersion("0.99.148.0")]

View file

@ -34,7 +34,22 @@ namespace Discord_Media_Loader
downloadManager.StartDownload();
downloadManager.ShowDialog();
ZipFile.ExtractToDirectory(tmpFile, AppDomain.CurrentDomain.BaseDirectory);
var tmpFolder = Path.GetTempFileName();
tmpFolder = Path.Combine(Path.GetFullPath(tmpFolder).Replace(Path.GetFileName(tmpFolder),""), Path.GetFileNameWithoutExtension(tmpFolder));
var di = Directory.CreateDirectory(tmpFolder);
ZipFile.ExtractToDirectory(tmpFile, tmpFolder);
foreach (var f in di.GetFiles())
{
try
{
var fname = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, f.Name);
File.Copy(f.FullName, fname, true);
}
catch (Exception) { }
}
File.Delete(tmpFile);
}