mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
Fixed null reference of MediaPart (#8104)
Fixed null reference of `MediaPart` on Page content item creation when `_contentItems.Value` was null.
This commit is contained in:
committed by
Sébastien Ros
parent
0669fdb345
commit
ee38f614cc
@@ -18,7 +18,7 @@ namespace Orchard.MediaLibrary.Fields {
|
||||
|
||||
public IEnumerable<MediaPart> MediaParts {
|
||||
get {
|
||||
return _contentItems != null ? _contentItems.Value : Enumerable.Empty<MediaPart>();
|
||||
return _contentItems != null ? (_contentItems.Value ?? Enumerable.Empty<MediaPart>()) : Enumerable.Empty<MediaPart>();
|
||||
}
|
||||
set { _contentItems.Value = value; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user