Skip to content

Commit

Permalink
Support byte[] -> byte_array in Construct.GetConstruct()
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter12345 committed Jan 11, 2025
1 parent 4071996 commit 978a844
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/laytonsmith/core/constructs/Construct.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ public static Construct GetConstruct(Object o, boolean allowResources) throws Cl
a.push(GetConstruct(obj, allowResources), Target.UNKNOWN);
}
return a;
} else if(o instanceof byte[]) {
byte[] data = (byte[]) o;
CByteArray ba = new CByteArray(Target.UNKNOWN, data.length);
ba.putBytes(data, 0);
return ba;
} else {
throw new ClassCastException(o.getClass().getName() + " cannot be cast to a Construct type");
}
Expand Down

0 comments on commit 978a844

Please sign in to comment.