Javascript error a.lastsong is null

javascript error a.lastsong is null

Chrome, extension, extension, javascript / Sudo Null IT News. args = []sprers.eu(arguments); var result, error; var props = { args: args, self: this. Error opening subprocess with fork() and AVCaptureSession //The stuff to change the audiofiles and play them var lastSong = null; var selection = null;. image for error. JavaScript required. We're sorry, but WorldCat does not work without JavaScript enabled. Please enable JavaScript on your browser. javascript error a.lastsong is null

Javascript error a.lastsong is null - pity, that

strcmp(drecord->d_name,"..") == 0 )
  •             {
  •                 //Either this dir or parent dir so we don't want to start another search here.
  •                 continue;
  •             }
  •             dirSearch(drecord->d_name, extensionWanted); //Recursion.
  •         }
  •         else //a file
  •         {
  •             fileExtension = (char*)getExtension(drecord->d_name);
  •             if (fileExtension != NULL)
  •             {
  •                 //Check file is of the type wanted.
  •                 if (strcmp(fileExtension, extensionWanted) == 0)
  •                 {
  •                     printf("file wanted, name = %s\n",drecord->d_name);
  •                     currentSong->file = drecord;
  •  
  •                     /*taglibFile = taglib_file_new(drecord->d_name);
  •                     if (currentSong->taglibFile == NULL)
  •                         printf("its null\n");
  •                     else
  •                     {
  •                         printf("its not null\n");
  •                         printf("curr song name = %s\n", currentSong->file->d_name);
  •                     }
  •                     currentSong->taglibFile = taglibFile;*/
  •  
  •                     if (previousSong == NULL) //This will be the first song.
  •                         currentSong->previous = NULL;
  •                     else
  •                         currentSong->previous = previousSong;
  •  
  •                     nextSong = malloc(sizeof(*nextSong));
  •                     if (nextSong == NULL)
  •                         printf("Error allocating memory.\n");
  •                     currentSong->next = nextSong;
  •  
  •                     previousSong = currentSong;
  •                     currentSong = nextSong;
  •                 }
  •             }
  •         }
  •     }
  •     closedir(dhandle);
  • }
  •  
  • int saveMusicCollection(void)
  • {
  •     if (firstSong == NULL)
  •         return(0); //No data to write.
  •  
  •     datafile = fopen(filename, "wb");
  •  
  •     if (datafile == NULL)
  •     {
  •         printf("Error writing to %s\n", filename);
  •         return(1);
  •     }
  •  
  •     currentSong = firstSong;
  •     while (currentSong != NULL)
  •     {
  •         fwrite(currentSong, sizeof(*currentSong), 1, datafile);
  •         printf("in save File - %s\n", currentSong->file->d_name);
  •         currentSong = currentSong->next;
  •         //printf("file pointer at = %d\n", ftell(datafile));
  •         //printf("size of song = %d\n", sizeof(struct song));
  •     }
  •     fclose(datafile);
  •     printf("Data saved to %s\n", filename);
  •  
  •     return(0);
  • /// <summary>
  • ////fgsg
  • /// </summary>
  •     /*datafile = fopen("sprers.eu", "w");
  •  
  •     if (datafile == NULL)
  •     {
  •         printf("Error writing to %s\n", filename);
  •         return(1);
  •     }
  •  
  •     currentSong = firstSong;
  •     while (currentSong != NULL)
  •     {
  •         fprintf(datafile, currentSong->file->d_name);
  •         printf("File - %s\n", currentSong->file->d_name);
  •         currentSong = currentSong->next;
  •     }
  •     fclose(datafile);
  •     printf("Data saved to %s\n", "sprers.eu");
  •  
  •  
  •     return(0);*/
  • }
  •  
  • int loadMusicCollection(void)
  • {
  •     datafile = fopen(filename, "rb");
  •     if(datafile != NULL)
  •     {
  •         firstSong = malloc(sizeof(*firstSong));
  •         if (firstSong == NULL)
  •             printf("Error allocating memory.\n");
  •         currentSong = firstSong;
  •         while(TRUE)
  •         {
  •             fread(currentSong, sizeof(*currentSong), 1, datafile);
  •             printf("File - %s\n", currentSong->file->d_name);
  •  
  •             if (previousSong == NULL) //This will be the first song.
  •                 currentSong->previous = NULL;
  •             else
  •                 currentSong->previous = previousSong;
  •  
  •             if (currentSong->next == NULL) //No more songs.
  •                 break;
  •  
  •             previousSong = currentSong;
  •             nextSong = malloc(sizeof(*nextSong));
  •             if (nextSong == NULL)
  •                         printf("Error allocating memory.\n");
  •             currentSong->next = nextSong;
  •             currentSong = nextSong;
  •         }
  •         fclose(datafile);
  •         printf("Data read from %s\n", filename);
  •         return(0);
  •     }
  •     else
  •     {
  •         printf("Error reading from %s\n", filename);
  •         return(1);
  •     }
  • }
  •  
  • void readMusicCollection(void)
  • {
  •     //TagLib_Tag *tag;
  •  
  •     currentSong = firstSong;
  •     while (currentSong != NULL)
  •     {
  •         //if (currentSong->taglibFile != NULL)
  •         //{
  •         //    tag = taglib_file_tag(currentSong->taglibFile);
  •  
  •             printf("File - %s\n", currentSong->file->d_name);
  •             //printf("Artist - %s\n", taglib_tag_artist(tag));
  •             //printf("Title - %s\n", taglib_tag_title(tag));
  •         //}
  •         currentSong = currentSong -> next;
  •         puts("\n");
  •     }
  • }
  •  
  • The getExtension() funtion is in another file (no problems with this function):

    1. #include <stdio.h>
    2. #include <string.h>
    3.  
    4. /*
    5.  *    Get the extension of a fileName (pointer to a string).
    6.  *    Return that extension (as a pointer) or NULL if there
    7.  *    is no extension.
    8.  */
    9. char* getExtension(char *fileName)
    10. {
    11.     char search_char = '.';
    12.     char *position = NULL;
    13.     int index;
    14.     char *extension = NULL;
    15.  
    16.     //Search for the last ".".
    17.     position = strrchr(fileName, search_char);
    18.     if (position == NULL) //No extension
    19.     {
    20.         return(NULL);
    21.     }
    22.     else //Has extension.
    23.     {
    24.         index = fileName - position;
    25.  
    26.         if (index < 0)
    27.         {
    28.             index *= -1; //Take absolute value.
    29.         }
    30.  
    31.         //Now work out the extension.
    32.         extension = position + 1;
    33.  
    34.         return extension;
    35.     }
    36. }
    37.