From 2e1d62a078f122fe4b8ad0e8d7c99c5719c52486 Mon Sep 17 00:00:00 2001
From: pkupczyk <pkupczyk>
Date: Fri, 22 Mar 2013 10:06:18 +0000
Subject: [PATCH] SP-557 / BIS-151 : openbis.js - replace /resources/js/* with
 resources/js-new/* and make sure the webapps still work - make logout
 callback optional

SVN: 28674
---
 .../cisd/openbis/public/resources/js/openbis.js    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js
index f66cb59c561..1c15bcc2854 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js
@@ -67,7 +67,9 @@ _openbisInternal.prototype.ajaxRequestSuccess = function(action){
 		if(response.error){
 			openbisObj.log("Request failed: " + JSON.stringify(response.error));
 		}
-		action(response);
+		if(action){
+			action(response);
+		}
 	};
 }
 
@@ -75,9 +77,11 @@ _openbisInternal.prototype.ajaxRequestError = function(action){
 	var openbisObj = this;
 	return function(xhr, status, error){
 		openbisObj.log("Request failed: " + error);
-		action({
-			"error" : "Request failed: " + error
-		});
+		if(action){
+			action({
+				"error" : "Request failed: " + error
+			});
+		}
 	};
 }
 
@@ -393,7 +397,7 @@ openbis.prototype.logout = function(action) {
 				  },
 			success: action
 		});
-	}else{
+	}else if(action){
 		action({ result : null });
 	}
 }
-- 
GitLab