Derek Bodin created MRM-1858:
--------------------------------

             Summary: Javascript error when no archiva_login cookie present
                 Key: MRM-1858
                 URL: https://jira.codehaus.org/browse/MRM-1858
             Project: Archiva
          Issue Type: Bug
          Components: browser
    Affects Versions: 2.1.0
         Environment: linux / debian / chrome / ie
            Reporter: Derek Bodin


When the archiva_login cookie is not present the method to retrieve the user 
session fails with a javascript error.  This causes the main page to not load 
correctly.

Adding the snippet below fixes the issue - but probably doesn't conform to your 
style guidelines.

js/archiva/main.js:68
{code}
    if(!cookieContent) return null;
{code}

The underlying problem is that cookieContent is undefined and the call to 
{code}$.parseJSON(cookieContent);{code} requires valid JSON.

{quote}
http://api.jquery.com/jquery.parsejson/
Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if 
it was passed an empty string, null, or undefined, even though those are not 
valid JSON.
{quote}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to