mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1596 from Flow-Launcher/fix_null_reference_contextmenu_item
fix null reference when clicking on Set Item to Top or plugin website
This commit is contained in:
commit
a9a7179b44
1 changed files with 15 additions and 6 deletions
|
|
@ -97,17 +97,26 @@ namespace Flow.Launcher
|
|||
|
||||
private void ResultList_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (Mouse.DirectlyOver is not FrameworkElement { DataContext: ResultViewModel result })
|
||||
return;
|
||||
if (Mouse.DirectlyOver is not FrameworkElement
|
||||
{
|
||||
DataContext: ResultViewModel
|
||||
{
|
||||
Result:
|
||||
{
|
||||
CopyText: { } copyText,
|
||||
OriginQuery.RawQuery: { } rawQuery
|
||||
}
|
||||
}
|
||||
}) return;
|
||||
|
||||
path = result.Result.CopyText;
|
||||
query = result.Result.OriginQuery.RawQuery;
|
||||
path = copyText;
|
||||
query = rawQuery;
|
||||
start = e.GetPosition(null);
|
||||
isDragging = true;
|
||||
}
|
||||
private void ResultList_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.LeftButton != MouseButtonState.Pressed|| !isDragging)
|
||||
if (e.LeftButton != MouseButtonState.Pressed || !isDragging)
|
||||
{
|
||||
start = default;
|
||||
path = string.Empty;
|
||||
|
|
@ -127,7 +136,7 @@ namespace Flow.Launcher
|
|||
return;
|
||||
|
||||
isDragging = false;
|
||||
|
||||
|
||||
var data = new DataObject(DataFormats.FileDrop, new[]
|
||||
{
|
||||
path
|
||||
|
|
|
|||
Loading…
Reference in a new issue