[MediaWiki-commits] [Gerrit] Workaround crasher when lastmodified date is bogus - change (apps...wikipedia)

2014-08-01 Thread Brion VIBBER (Code Review)
Brion VIBBER has uploaded a new change for review.

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

Change subject: Workaround crasher when lastmodified date is bogus
..

Workaround crasher when lastmodified date is bogus

We still need to track down the cause, will add reporting logic later

Change-Id: I75d1dcbb8fd971c80d3bfd81419475078462544b
---
M wikipedia/Data/Operations/DownloadSectionsOp.m
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/wikipedia/Data/Operations/DownloadSectionsOp.m 
b/wikipedia/Data/Operations/DownloadSectionsOp.m
index 228adc6..d815f72 100644
--- a/wikipedia/Data/Operations/DownloadSectionsOp.m
+++ b/wikipedia/Data/Operations/DownloadSectionsOp.m
@@ -113,6 +113,10 @@
 
 NSString *lastmodifiedDateString = 
weakSelf.jsonRetrieved[@mobileview][@lastmodified];
 NSDate *lastmodifiedDate = [lastmodifiedDateString 
getDateFromIso8601DateString];
+if (!lastmodifiedDate) {
+NSLog(@Bad lastmodified date, will show as recently modified 
as a workaround);
+lastmodifiedDate = [[NSDate alloc] init];
+}
 
 NSDictionary *lastmodifiedbyDict = 
weakSelf.jsonRetrieved[@mobileview][@lastmodifiedby];
 NSString *lastmodifiedby = @;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75d1dcbb8fd971c80d3bfd81419475078462544b
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER br...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Workaround crasher when lastmodified date is bogus - change (apps...wikipedia)

2014-08-01 Thread Mhurd (Code Review)
Mhurd has submitted this change and it was merged.

Change subject: Workaround crasher when lastmodified date is bogus
..


Workaround crasher when lastmodified date is bogus

We still need to track down the cause, will add reporting logic later

Change-Id: I75d1dcbb8fd971c80d3bfd81419475078462544b
---
M wikipedia/Data/Operations/DownloadSectionsOp.m
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Mhurd: Verified; Looks good to me, approved



diff --git a/wikipedia/Data/Operations/DownloadSectionsOp.m 
b/wikipedia/Data/Operations/DownloadSectionsOp.m
index 228adc6..d815f72 100644
--- a/wikipedia/Data/Operations/DownloadSectionsOp.m
+++ b/wikipedia/Data/Operations/DownloadSectionsOp.m
@@ -113,6 +113,10 @@
 
 NSString *lastmodifiedDateString = 
weakSelf.jsonRetrieved[@mobileview][@lastmodified];
 NSDate *lastmodifiedDate = [lastmodifiedDateString 
getDateFromIso8601DateString];
+if (!lastmodifiedDate) {
+NSLog(@Bad lastmodified date, will show as recently modified 
as a workaround);
+lastmodifiedDate = [[NSDate alloc] init];
+}
 
 NSDictionary *lastmodifiedbyDict = 
weakSelf.jsonRetrieved[@mobileview][@lastmodifiedby];
 NSString *lastmodifiedby = @;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I75d1dcbb8fd971c80d3bfd81419475078462544b
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Mhurd mh...@wikimedia.org

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