[backend/core] Fix runtime ArrayTypeMismatchException in EmojiService
This commit is contained in:
parent
b8ba778842
commit
ce646e84d9
1 changed files with 17 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using AsyncKeyedLock;
|
||||
using Iceshrimp.Backend.Core.Configuration;
|
||||
|
@ -71,8 +72,8 @@ public partial class EmojiService(
|
|||
{
|
||||
var user = await sysUserSvc.GetInstanceActorAsync();
|
||||
var driveFile = await driveSvc.StoreFileAsync(existing.OriginalUrl, user, false, forceStore: true,
|
||||
skipImageProcessing: false) ??
|
||||
throw new Exception("Error storing emoji file");
|
||||
skipImageProcessing: false)
|
||||
?? throw new Exception("Error storing emoji file");
|
||||
|
||||
var emoji = new Emoji
|
||||
{
|
||||
|
@ -206,6 +207,19 @@ public partial class EmojiService(
|
|||
}
|
||||
}
|
||||
|
||||
[OverloadResolutionPriority(1)]
|
||||
private static void ResolveChildren(
|
||||
Span<IMfmInlineNode> nodes, ref List<MfmEmojiCodeNode> list
|
||||
)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
if (node is MfmEmojiCodeNode emojiNode) list.Add(emojiNode);
|
||||
list.AddRange(node.Children.OfType<MfmEmojiCodeNode>());
|
||||
ResolveChildren(node.Children, ref list);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Emoji?> UpdateLocalEmojiAsync(
|
||||
string id, string? name, List<string>? aliases, string? category, string? license, bool? sensitive
|
||||
)
|
||||
|
@ -245,4 +259,4 @@ public partial class EmojiService(
|
|||
|
||||
[GeneratedRegex(@"^:?([\w+-]+)@([a-zA-Z0-9._\-]+\.[a-zA-Z0-9._\-]+):?$", RegexOptions.Compiled)]
|
||||
private static partial Regex RemoteCustomEmojiRegex { get; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue