diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-06-20 16:48:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-20 16:48:48 +0200 |
| commit | beb3896d7fba09e038b45c784273dbea1e48013c (patch) | |
| tree | 55e9c9102f67e11ac0225c25166c2e4caaf012eb /Jellyfin.Data/Entities/CollectionItem.cs | |
| parent | e8e5208fbd9484a1b37eed5dece524f108886fe0 (diff) | |
| parent | 6556bec646a28d08267f30640125865cf42240d0 (diff) | |
Merge pull request #3390 from telans/fixes
Multiple warning fixes
Diffstat (limited to 'Jellyfin.Data/Entities/CollectionItem.cs')
| -rw-r--r-- | Jellyfin.Data/Entities/CollectionItem.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Jellyfin.Data/Entities/CollectionItem.cs b/Jellyfin.Data/Entities/CollectionItem.cs index 7cfdbbe16..d879806ee 100644 --- a/Jellyfin.Data/Entities/CollectionItem.cs +++ b/Jellyfin.Data/Entities/CollectionItem.cs @@ -38,15 +38,26 @@ namespace Jellyfin.Data.Entities // NOTE: This class has one-to-one associations with CollectionItem. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. - if (_collection0 == null) throw new ArgumentNullException(nameof(_collection0)); + if (_collection0 == null) + { + throw new ArgumentNullException(nameof(_collection0)); + } + _collection0.CollectionItem.Add(this); - if (_collectionitem1 == null) throw new ArgumentNullException(nameof(_collectionitem1)); + if (_collectionitem1 == null) + { + throw new ArgumentNullException(nameof(_collectionitem1)); + } + _collectionitem1.Next = this; - if (_collectionitem2 == null) throw new ArgumentNullException(nameof(_collectionitem2)); - _collectionitem2.Previous = this; + if (_collectionitem2 == null) + { + throw new ArgumentNullException(nameof(_collectionitem2)); + } + _collectionitem2.Previous = this; Init(); } @@ -91,7 +102,7 @@ namespace Jellyfin.Data.Entities { int value = _Id; GetId(ref value); - return (_Id = value); + return _Id = value; } protected set |
