Javascript error on bug page when diff has 0 lines

Bug #517266 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Paul Hummer

Bug Description

In https://bugs.edge.launchpad.net/lpbuildbot/+bug/508025, one of the linked branches has a merge proposal with a diff of zero lines, and so the link to the diff is, erm, well, it's not a link, it just says "0 lines". This causes a javascript error "TypeError: Cannot call method 'addClass' of null" in the following code:

  var popupdiff=Y.namespace('code.branchmergeproposal.popupdiff');
  function link_popup_diff_onclick(node){
    var a = node.query('a.diff-link');
    a.addClass('js-action');
    var librarian_url = a.getAttribute('href');
    var api_url=node.query('a.api-ref').getAttribute('href');
    a.on('click',function(e){
      e.preventDefault();
      display_diff(a,api_url,librarian_url);
    });
  }

Unfortunately, this error stops execution such that, for example, the status and importance pickers no longer work.

Related branches

Paul Hummer (rockstar)
Changed in launchpad-code:
assignee: nobody → Paul Hummer (rockstar)
milestone: none → 10.02
status: Triaged → In Progress
Revision history for this message
Paul Hummer (rockstar) wrote :

Fixed in devel 10350

Changed in launchpad-code:
status: In Progress → Fix Committed
Paul Hummer (rockstar)
Changed in launchpad-code:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.