diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.cshtml b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.cshtml index 103d6b2aeed..6e5024897ba 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.cshtml @@ -14,7 +14,7 @@ { var path = paths[i]; var url = Orchard.AssetUrl(path); - var text = !string.IsNullOrEmpty(mediaTexts[i]) ? mediaTexts[i] : path; + var text = !string.IsNullOrEmpty(mediaTexts.ElementAtOrDefault(i)) ? mediaTexts[i] : path; if (Orchard.IsImageFile(path)) {