Uploaded image for project: 'Archiva (Retired)'
  1. Archiva (Retired)
  2. MRM-1858

Javascript error when no archiva_login cookie present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.1.0
    • 2.1.1
    • browser
    • None
    • linux / debian / chrome / ie

    Description

      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

          if(!cookieContent) return null;
      

      The underlying problem is that cookieContent is undefined and the call to

      $.parseJSON(cookieContent);

      requires valid JSON.

      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.

      Attachments

        Issue Links

          Activity

            People

              olamy Olivier Lamy
              bodinda Derek Bodin
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: