fix: allow all types to call "haskeys".

This commit is contained in:
redxef 2024-11-08 22:39:56 +01:00
parent 5cfb35a239
commit 7bf2923ad1
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -141,7 +141,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
return args.Last(); return args.Last();
} }
private static Expression _haskeys(IEnumerable<Expression> args) { private static Expression _haskeys(IEnumerable<Expression> args) {
Object o = (Object) args.First(); Object o = new Object(((IInner) args.First()).Inner());
foreach (var e in args.Skip(1)) { foreach (var e in args.Skip(1)) {
String s = (String) e; String s = (String) e;
PropertyInfo? pi = o.Value().GetType().GetProperty(s.Value()); PropertyInfo? pi = o.Value().GetType().GetProperty(s.Value());