Return None when a matrix cannot be applied.

This commit is contained in:
kenkeiras 2017-05-24 22:16:30 +02:00
parent 89b281fd6f
commit 9ed43aa362

View File

@ -130,6 +130,8 @@ def apply_remix(tokens, remix):
rebuilt = []
for i in remix:
if isinstance(i, int):
if i >= len(tokens):
return None
rebuilt.append(tokens[i])
else:
assert(isinstance(i, str))