Skip to content

Commit

Permalink
Fix crash when drag and dropping APK file
Browse files Browse the repository at this point in the history
  • Loading branch information
AndnixSH committed Sep 16, 2023
1 parent 75e0566 commit de4f176
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion APKToolGUI/Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ internal async Task GetApkInfo(string file)
try
{
string splitPath = Path.Combine(Program.TEMP_PATH, "SplitInfo");
string arch = null;
string arch = "";

await Task.Factory.StartNew(() =>
{
Expand Down
5 changes: 3 additions & 2 deletions APKToolGUI/Utils/DragDropUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Windows.Markup;

namespace SaveToGameWpf.Logic.Utils
{
Expand Down Expand Up @@ -39,7 +40,7 @@ public static void CheckDragEnter(this DragEventArgs e, params string[] extensio
string[] files = e.GetFilesDrop();
if (extensions == null && Directory.Exists(files[0]))
e.Effect = DragDropEffects.Copy;
else if (extensions.Any(ext => files[0].EndsWith(ext, StringComparison.Ordinal)))
else if (extensions != null && extensions.Any(ext => files[0].EndsWith(ext, StringComparison.Ordinal)))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
Expand Down Expand Up @@ -73,7 +74,7 @@ public static bool CheckManyDragOver(this DragEventArgs e, params string[] exten
e.Effect = DragDropEffects.Move;
return true;
}
else if (extensions.Any(ext => files[0].EndsWith(ext, StringComparison.Ordinal)))
else if (extensions != null && extensions.Any(ext => files[0].EndsWith(ext, StringComparison.Ordinal)))
{
e.Effect = DragDropEffects.Move;
return true;
Expand Down

0 comments on commit de4f176

Please sign in to comment.