Skip to content

Commit e9c4155

Browse files
committed
Fix a crash happening when dropping on the window
1 parent 45f588a commit e9c4155

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PROShine/Views/MainWindow.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,11 @@ private void LoginButton_Click(object sender, RoutedEventArgs e)
943943

944944
private void MainWindow_OnDrop(object sender, DragEventArgs e)
945945
{
946-
string[] file = (string[])e.Data.GetData(DataFormats.FileDrop);
947-
LoadScript(file[0]);
946+
string[] file = e.Data?.GetData(DataFormats.FileDrop) as string[];
947+
if (file != null && file.Length > 0)
948+
{
949+
LoadScript(file[0]);
950+
}
948951
}
949952
}
950953
}

0 commit comments

Comments
 (0)