Fjalapeno has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/210931

Change subject: Fix crash Bug T99081 when removing an item from history.
......................................................................

Fix crash Bug T99081 when removing an item from history.

Crash was caused by querying a dictionary for a nil key (nil article title).
Now checking that the title is non-nil before attempting to remove the history 
item.
Also fixed the corollary method for adding a history item.

Change-Id: I4a481780f8937f48eaae3935fde881e2f5522cd1
---
M MediaWikiKit/MediaWikiKit/MWKHistoryList.m
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/31/210931/1

diff --git a/MediaWikiKit/MediaWikiKit/MWKHistoryList.m 
b/MediaWikiKit/MediaWikiKit/MWKHistoryList.m
index 7ac6d68..c2d1952 100644
--- a/MediaWikiKit/MediaWikiKit/MWKHistoryList.m
+++ b/MediaWikiKit/MediaWikiKit/MWKHistoryList.m
@@ -58,6 +58,9 @@
 #pragma mark - update methods
 
 - (void)addEntry:(MWKHistoryEntry*)entry {
+    if (entry.title == nil) {
+        return;
+    }
     MWKHistoryEntry* oldEntry = [self entryForTitle:entry.title];
     if (oldEntry) {
         // Replace the old entry and move to top
@@ -69,6 +72,9 @@
 }
 
 - (void)removeEntry:(MWKHistoryEntry*)entry {
+    if (entry.title == nil) {
+        return;
+    }
     [entries removeObject:entry];
     [entriesByTitle removeObjectForKey:entry.title];
     _dirty = YES;

-- 
To view, visit https://gerrit.wikimedia.org/r/210931
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a481780f8937f48eaae3935fde881e2f5522cd1
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Fjalapeno <cfl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to