From 6aa01d2e7a9d80c9550d9e06892fd39a2a7b6574 Mon Sep 17 00:00:00 2001 From: dilanua Date: Mon, 12 Sep 2016 14:17:44 +0530 Subject: [PATCH] Fixing NPE issue in token-protected-service-invokers - UI --- .../app/modules/oauth/token-protected-service-invokers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js index 185f82d8576..6520a819b5d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js @@ -45,9 +45,9 @@ var invokers = function () { * If the token pair is not set in the session, this will return null. */ privateMethods.getAccessToken = function () { - var tokenPair = parse(session.get(constants["TOKEN_PAIR"])); + var tokenPair = session.get(constants["TOKEN_PAIR"]); if (tokenPair) { - return tokenPair["accessToken"]; + return parse(tokenPair)["accessToken"]; } else { return null; }