Jump to content

A lot of errors in log


Super957
Go to solution Solved by Luke,

Recommended Posts

Super957

I search to update my libraries because i insert ne library "Music"...no info are found.

So i open and log file and i ask you why so many error....

Could it be a consequence of the synchronization of the disks on the Qnap as I am expanding the capacity of the disks by replacing them one by one?

Thank

Hispa

 

embyserver (10).rar

Edited by Super957
Link to comment
Share on other sites

roaku

@Luke

Yes, Iconic is error-ing out near the beginning of its process when it tries to find the library the item of the requested image is in. This is to determine if that library is activated for Iconic.

That's also the first point in the code the plugin attempts to use the Plugin.Instance.PluginConfiguration object.

So, I would guess that Iconic's configuration xml file isn't readable for some reason right now or is otherwise malformed, preventing Emby from serializing the xml into the configuration object Iconic reads from, resulting in the null reference.

The only other thing I can think of is that my code assumes  ILibraryManager.GetCollectionFolders will never return null. If that method returns null, the plugin would react badly like this.

Edited by roaku
Link to comment
Share on other sites

If you want to show me the code for the Supports method I might be able to spot something.

Link to comment
Share on other sites

roaku
3 minutes ago, Luke said:

If you want to show me the code for the Supports method I might be able to spot something.

Sure, thanks.

The exception is happening in the GetLibraryId method, which Supports is calling, so I'm showing both here:
 

bool IImageEnhancer.Supports(BaseItem item, ImageType imageType)
{
  if (!CheckPlatform()) {
    return false;
  }

  //The call that leads to the error
  Nullable<Guid> libraryIdOption = GetLibraryId(item);

  if (!libraryIdOption.HasValue) {
    return false;
  }
  
  LibraryGroup libraryGroup = GetLibraryGroup(libraryIdOption.Value);
  if (libraryGroup == null || !libraryGroup.Active) {
    return false;
  }
  
  return DoProcess(item);
}

private Nullable<Guid> GetLibraryId(BaseItem item) {
  Nullable<Guid> libraryIdOption = null;
  
  //I'm not expecting/handling a null here
  Folder[] test = _libraryManager.GetCollectionFolders(item);
  
  foreach (Folder f in test) {
    //If some portion of this object doesn't exist, I expect this ContainsKey check would trigger the null exception
    if (Plugin.Instance.PluginConfiguration.LibraryGroups.ContainsKey(f.Id)) {
      libraryIdOption = f.Id;
      break;
    }
  }
  return libraryIdOption;
}

 

Link to comment
Share on other sites

Try just using var instead of the Folder class, in both places in the GetLibraryId method.

Link to comment
Share on other sites

roaku
1 hour ago, Luke said:

Try just using var instead of the Folder class, in both places in the GetLibraryId method.

Ok, I'll revisit that code soon.

  • Thanks 1
Link to comment
Share on other sites

Super957
20 hours ago, Luke said:

Hi, try removing the Iconic plugin.

Yep thank i uninstall and solved

 

Hispa

Edited by Super957
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...