fix: allow programs to not be a list.
This commit is contained in:
parent
805d0efb4f
commit
c9d7f1ee60
2 changed files with 6 additions and 2 deletions
|
@ -78,7 +78,10 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp.Compiler {
|
|||
}
|
||||
value += t;
|
||||
}
|
||||
return null;
|
||||
if (value.Equals("")) {
|
||||
return null;
|
||||
}
|
||||
return new AtomToken(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +104,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp.Compiler {
|
|||
if (prev_avail == program.Available() && prev_avail == 0) {
|
||||
break;
|
||||
} else if (prev_avail == program.Available()) {
|
||||
throw new ApplicationException("Program is invalid");
|
||||
throw new ApplicationException($"Program is invalid, still available: {program.Available()}");
|
||||
}
|
||||
prev_avail = program.Available();
|
||||
foreach (Type c in _classes) {
|
||||
|
|
|
@ -148,6 +148,7 @@ namespace Tests
|
|||
(if (> 0 1) (car (quote (1 2 3))) (cdr (quote (2 3 4)))))
|
||||
""").ToString());
|
||||
|
||||
Assert.Equal("a", e.eval("'a").ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Loading…
Reference in a new issue