OSDN Git Service

ListViewItemCache.TargetListがキャッシュ生成対象のListViewと一致しているかチェックする
authorKimura Youichi <kim.upsilon@bucyou.net>
Thu, 25 Aug 2016 17:34:32 +0000 (02:34 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Thu, 25 Aug 2016 17:36:07 +0000 (02:36 +0900)
OpenTween/Tween.cs

index 5c30858..08acdc1 100644 (file)
@@ -4819,7 +4819,7 @@ namespace OpenTween
                 return;
 
             var listCache = this._listItemCache;
-            if (listCache != null && listCache.IsSupersetOf(e.StartIndex, e.EndIndex))
+            if (listCache?.TargetList == sender && listCache.IsSupersetOf(e.StartIndex, e.EndIndex))
             {
                 // If the newly requested cache is a subset of the old cache,
                 // no need to rebuild everything, so do nothing.
@@ -4833,7 +4833,7 @@ namespace OpenTween
         private void MyList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
         {
             var listCache = this._listItemCache;
-            if (listCache != null && listCache.TargetList == sender)
+            if (listCache?.TargetList == sender)
             {
                 ListViewItem item;
                 PostClass cacheItemPost;