mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
missing nullchecks and casts
This commit is contained in:
parent
87676d2994
commit
20a865f012
1 changed files with 5 additions and 2 deletions
|
|
@ -182,7 +182,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
|
||||
Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance))
|
||||
{
|
||||
ListView listView = sender as ListView;
|
||||
var listView = (ListView)sender;
|
||||
ListViewItem listViewItem = FindAncestor<ListViewItem>((DependencyObject)e.OriginalSource);
|
||||
|
||||
if (listViewItem == null) return;
|
||||
|
|
@ -199,7 +199,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
if (e.Data.GetDataPresent(typeof(SearchSource)))
|
||||
{
|
||||
SearchSource droppedData = e.Data.GetData(typeof(SearchSource)) as SearchSource;
|
||||
ListView listView = sender as ListView;
|
||||
var listView = (ListView)sender;
|
||||
var target = GetNearestContainer(e.OriginalSource);
|
||||
|
||||
if (target == null)
|
||||
|
|
@ -207,6 +207,9 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
|
||||
SearchSource targetData = (SearchSource)listView.ItemContainerGenerator.ItemFromContainer(target);
|
||||
|
||||
if (targetData == null)
|
||||
return;
|
||||
|
||||
var items = _settings.SearchSources;
|
||||
int removedIdx = items.IndexOf(droppedData);
|
||||
int targetIdx = items.IndexOf(targetData);
|
||||
|
|
|
|||
Loading…
Reference in a new issue