Skip to content

Commit 978a844

Browse files
committed
Support byte[] -> byte_array in Construct.GetConstruct()
1 parent 4071996 commit 978a844

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/com/laytonsmith/core/constructs/Construct.java

+5
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,11 @@ public static Construct GetConstruct(Object o, boolean allowResources) throws Cl
380380
a.push(GetConstruct(obj, allowResources), Target.UNKNOWN);
381381
}
382382
return a;
383+
} else if(o instanceof byte[]) {
384+
byte[] data = (byte[]) o;
385+
CByteArray ba = new CByteArray(Target.UNKNOWN, data.length);
386+
ba.putBytes(data, 0);
387+
return ba;
383388
} else {
384389
throw new ClassCastException(o.getClass().getName() + " cannot be cast to a Construct type");
385390
}

0 commit comments

Comments
 (0)