alterwiel

Cannot read property 'ssl' of null on Launch

Discussion created by alterwiel on May 28, 2015
Latest reply on Nov 23, 2015 by alterwiel

I get this error in the console when I try to "Launch" my app. I found that an extra condition in the ConfigManager.js, where the error occurs, resolves this.

 

Line 472:

_processWebTier: function(appConfig){

    var def = new Deferred();

    var portalUrl = appConfig.portalUrl;

    if(appConfig.isWebTier){

        //Although it is recommended to enable ssl for IWA/PKI portal by Esri,

        //there is no force on the client. They still can use http for IWA/PKI.

        //It is not correnct to assume web-tier authorization only works with https.

        tokenUtils.isWebTierPortal(portalUrl).then(lang.hitch(this, function(isWebTier) {

            var credential = tokenUtils.getPortalCredential(portalUrl);

            if(credential){ // condition added by alterwiel

                if(credential.ssl){

                    //if credential.ssl, it means that the protal is allSSL enabled

                    if(window.location.protocol === 'http:' && !tokenUtils.isInConfigOrPreviewWindow()){

                        window.location.protocol = 'https:';

                        return;

                    }

                }

            }

            def.resolve(isWebTier);

        }), lang.hitch(this, function(err) {

            def.reject(err);

        }));

    }else{

        def.resolve(false);

    }

    return def;

}

Outcomes