[Fix] Possible null reference. (#4585)

Fix possible null reference.
This commit is contained in:
BaronGreenback 2020-11-28 14:44:14 +00:00 committed by GitHub
parent f1b3811ca7
commit cab78f40b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -1,11 +1,11 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
namespace MediaBrowser.Common.Plugins
{
/// <summary>
/// Local plugin struct.
/// Local plugin class.
/// </summary>
public class LocalPlugin : IEquatable<LocalPlugin>
{
@ -106,6 +106,12 @@ namespace MediaBrowser.Common.Plugins
/// <inheritdoc />
public bool Equals(LocalPlugin other)
{
// Do not use == or != for comparison as this class overrides the operators.
if (object.ReferenceEquals(other, null))
{
return false;
}
return Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase)
&& Id.Equals(other.Id);
}