1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Add missing null handling for never Markdig version

This commit is contained in:
Dean Herbert 2021-06-07 16:08:44 +09:00
parent aa700702fe
commit e8d4147773
2 changed files with 6 additions and 3 deletions

View File

@ -30,9 +30,12 @@ namespace osu.Game.Graphics.Containers.Markdown
break;
case ListItemBlock listItemBlock:
var isOrdered = ((ListBlock)listItemBlock.Parent).IsOrdered;
var childContainer = CreateListItem(listItemBlock, level, isOrdered);
bool isOrdered = ((ListBlock)listItemBlock.Parent)?.IsOrdered == true;
OsuMarkdownListItem childContainer = CreateListItem(listItemBlock, level, isOrdered);
container.Add(childContainer);
foreach (var single in listItemBlock)
base.AddMarkdownComponent(single, childContainer.Content, level);
break;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Wiki.Markdown
case ParagraphBlock paragraphBlock:
// Check if paragraph only contains an image
if (paragraphBlock.Inline.Count() == 1 && paragraphBlock.Inline.FirstChild is LinkInline { IsImage: true } linkInline)
if (paragraphBlock.Inline?.Count() == 1 && paragraphBlock.Inline.FirstChild is LinkInline { IsImage: true } linkInline)
{
container.Add(new WikiMarkdownImageBlock(linkInline));
return;