Skip to content

Commit

Permalink
fix castException with byte[]
Browse files Browse the repository at this point in the history
In the Viewer there is a CastException in the Byte[] in some WAVE files
  • Loading branch information
samalloing authored Sep 17, 2024
1 parent 3a4808e commit 1a08d94
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,16 @@ private void addArrayMembers(DefaultMutableTreeNode node, Property p) {
break;
}
case BYTE: {
addToNode(node, (Byte[]) pVal);
break;
if (pVal instanceof byte[]) {
byte[] byteArray = (byte[]) pVal;
Byte[] byteObjectArray = new Byte[byteArray.length];
for (int i = 0; i < byteArray.length; i++) {
byteObjectArray[i] = byteArray[i]; // Autoboxing from byte to Byte
}
addToNode(node, (Byte[]) byteObjectArray);
} else {
addToNode(node, (Byte[]) pVal);
}
}
case STRING: {
addToNode(node, (String[]) pVal);
Expand Down

0 comments on commit 1a08d94

Please sign in to comment.