Skip to content

Null pointer exception while album list loads (Huge library) #25

@Atanamo

Description

@Atanamo

Hi!

Yet another problem with huge music library.
I let scan all files over night - which worked so far, don't understand the problem of issue #6 (Huge library makes Audios angry!)...
But when I open the albums list of Audios, it first takes a while, then getting a javascript error.

Here the exception as thrown to Chrome debug console:

Uncaught TypeError: Cannot read property 'length' of undefined   -   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:4 

x.extend.each           @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:4
(anonymous function)    @   app.js?v=a90372135c621c1a65a28e03ca7480d9:502
x.extend.each           @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:4
$.ajax.success          @   app.js?v=a90372135c621c1a65a28e03ca7480d9:405
c                       @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:4
p.fireWith              @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:4
k                       @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:6
r                       @   jquery.min.js?v=a90372135c621c1a65a28e03ca7480d9:6

Jumping into the code of app.js (line 502) shows these lines:

    var aSongs=[];
    $.each(songs[album.id],function(ii,songs){
        aSongs[ii] = $this.loadSongsRow(songs, album.name);
    });

So, what seems to be undefined here, is songs[album.id].
Probably the error can be catched by checking this expression appropriately.

Because, if the error occures, the whole view is broken - due to the fact that init was not finished.
E.g. I can click on the albums created so far, but the list of songs does not show up...


My environment:

  • OwnCloud 8.2.0
  • Music library has about 900 albums of 250 artists, over 10000 songs in total

Also, after a bit of debugging...
For the album, on which the error occures, there's indeed missing an entry in songs.
When I skip the foreach-loop for this album, the view finishes building up correctly!

So I wonder, if the album is empty or similar.
But I can play the album in Audios and from the files view of Owncloud. So what is looped there anyway? :-)

EDIT:
I've created a pull request, which fixes the issue...


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions