File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
LinkDotNet.Blog.Web/Features/Admin/BlogPostEditor/Components Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public static BlogPost Create(
116
116
PreviewImageUrl = previewImageUrl ,
117
117
PreviewImageUrlFallback = previewImageUrlFallback ,
118
118
IsPublished = isPublished ,
119
- Tags = tags ? . Select ( t => t . Trim ( ) ) . ToImmutableArray ( ) ,
119
+ Tags = tags ? . Select ( t => t . Trim ( ) ) . ToImmutableArray ( ) ?? ImmutableArray < string > . Empty ,
120
120
ReadingTimeInMinutes = ReadingTimeCalculator . CalculateReadingTime ( content ) ,
121
121
} ;
122
122
Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ public static CreateNewModel FromBlogPost(BlogPost blogPost)
108
108
109
109
public BlogPost ToBlogPost ( )
110
110
{
111
- var tagList = string . IsNullOrWhiteSpace ( Tags ) ? ArraySegment < string > . Empty : Tags . Split ( "," ) ;
111
+ var tagList = string . IsNullOrWhiteSpace ( Tags )
112
+ ? Array . Empty < string > ( )
113
+ : Tags . Split ( "," , StringSplitOptions . RemoveEmptyEntries ) ;
112
114
DateTime ? updatedDate = ShouldUpdateDate || originalUpdatedDate == default
113
115
? null
114
116
: originalUpdatedDate ;
You can’t perform that action at this time.
0 commit comments