Brion VIBBER has uploaded a new change for review.

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

Change subject: moar exceptions
......................................................................

moar exceptions

Change-Id: I0294d4e4d8e7efbe64b57c5657cc2b397930bab2
---
M MediaWikiKit/MediaWikiKit/MWKDataStore.m
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.m 
b/MediaWikiKit/MediaWikiKit/MWKDataStore.m
index e422097..d04f467 100644
--- a/MediaWikiKit/MediaWikiKit/MWKDataStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.m
@@ -261,6 +261,11 @@
     NSString *path = [self pathForTitle:title];
     NSString *filePath = [path 
stringByAppendingPathComponent:@"Article.plist"];
     NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:filePath];
+    if (dict == nil) {
+        @throw [NSException exceptionWithName:@"MWKDataStoreException"
+                                       reason:@"failed to load Article.plist"
+                                     userInfo:@{filePath: filePath}];
+    }
     return [[MWKArticle alloc] initWithTitle:title dict:dict];
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0294d4e4d8e7efbe64b57c5657cc2b397930bab2
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to