Skip to content

Commit 3530f50

Browse files
committed
Don't throw exception in yml_decode when result is a list
1 parent 33cb777 commit 3530f50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/laytonsmith/core/functions/DataTransformations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.Reader;
2020
import java.io.StringReader;
2121
import java.io.StringWriter;
22+
import java.util.Collection;
2223
import java.util.Map;
2324
import java.util.Properties;
2425
import javax.xml.xpath.XPathExpressionException;
@@ -228,11 +229,10 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
228229
} catch(ScannerException | ParserException ex){
229230
cause = ex;
230231
}
231-
if(!(ret instanceof Map)){
232+
if(!(ret instanceof Map) && !(ret instanceof Collection)){
232233
throw new Exceptions.FormatException("Improperly formatted YML", t, cause);
233234
}
234-
Map<String, Object> map = (Map<String, Object>) ret;
235-
return Construct.GetConstruct(map);
235+
return Construct.GetConstruct(ret);
236236
}
237237

238238
@Override

0 commit comments

Comments
 (0)