Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
supermomonga committed Jul 1, 2023
1 parent 75fd4fd commit f5ff267
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions MoEmbed.Core/Models/Metadata/TwitterExperimentalMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using MoEmbed.Models.TweetExperimental;

using Portable.Xaml.Markup;

using System;
using System.ComponentModel;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
using MoEmbed.Models.TweetExperimental;
using Portable.Xaml.Markup;

namespace MoEmbed.Models.Metadata
{
Expand Down Expand Up @@ -65,7 +67,7 @@ public override async Task<EmbedData> FetchAsync(RequestContext context)
},
Title = tweet.User.Name,
Description = tweet.Text,
Medias = tweet.MediaDetails.Select(ToMedia).ToList(),
Medias = tweet.MediaDetails?.Select(ToMedia).ToList() ?? new(),
RestrictionPolicy = tweet.PossiblySensitive ? RestrictionPolicies.Restricted : RestrictionPolicies.Safe,

ProviderName = "Twitter",
Expand Down

0 comments on commit f5ff267

Please sign in to comment.