From 94ca4b340fc503c3a94e1859094fda80b9b35c88 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Mon, 3 Dec 2012 13:05:36 +0000
Subject: [PATCH] BIS-159 SP-395 : Fix complaints from semantic analyzer

SVN: 27831
---
 openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m
index 3411514e5f1..a2e10403dd6 100644
--- a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m
+++ b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m
@@ -63,7 +63,10 @@
 - (void)verifyLoginURL:(NSURL *)openbisUrl username:(NSString *)username password:(NSString *)password sender:(CISDOBLoginViewController *)controller
 {
     NSError *error;
-    [self initializeServiceManager: openbisUrl error: &error];
+    if (![self initializeServiceManager: openbisUrl error: &error]) {
+        [controller showError: error];
+        return;
+    }
     
     CISDOBMasterViewController *masterViewController = [self masterViewController];
 
@@ -203,8 +206,7 @@
     NSURL *openbisUrl = [self openbisUrl];
     
     NSError *error;
-    [self initializeServiceManager: openbisUrl error: &error];
-    if (!_serviceManager) {
+    if (![self initializeServiceManager: openbisUrl error: &error]) {
         // TODO Implement error handling
         NSLog(@"Unresolved error -- could not create service manager %@, %@", error, [error userInfo]);
         abort();
@@ -213,7 +215,7 @@
     return _serviceManager;
 }
 
-- (void)initializeServiceManager:(NSURL *)openbisUrl error:(NSError **)error
+- (BOOL)initializeServiceManager:(NSURL *)openbisUrl error:(NSError **)error
 {
     
     NSURL *storeUrl = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"openBISData.sqlite"];
@@ -229,7 +231,10 @@
         _serviceManager =
             [[CISDOBIpadServiceManager alloc]
                 initWithStoreUrl: storeUrl openbisUrl: openbisUrl trusted: YES error: error];
+        if (!_serviceManager) return NO;
     }
+    
+    return YES;
 }
 
 - (CISDOBOpenBisModel *)rootOpenBisModel
-- 
GitLab