diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-11-28 14:44:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-28 15:44:14 +0100 |
| commit | cab78f40b3018e52234c2b1b871889866e3134b2 (patch) | |
| tree | ec88c2a1d50bcc320ebf51874741a69834fdcbaf | |
| parent | f1b3811ca7ac7858d19cbd51549fde9fca04bdb9 (diff) | |
[Fix] Possible null reference. (#4585)
Fix possible null reference.
| -rw-r--r-- | MediaBrowser.Common/Plugins/LocalPlugin.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/MediaBrowser.Common/Plugins/LocalPlugin.cs b/MediaBrowser.Common/Plugins/LocalPlugin.cs index 7927c663d..c97e75a3b 100644 --- a/MediaBrowser.Common/Plugins/LocalPlugin.cs +++ b/MediaBrowser.Common/Plugins/LocalPlugin.cs @@ -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); } |
