Skip to content

Commit

Permalink
fix(PS4): Fix serverCertificate defaulted to null (#6716)
Browse files Browse the repository at this point in the history
For some reason on PS4, the check `val.buffer.constructor == ArrayBuffer` returns `false` when it should be `true` which causes the object cloning to return `null` instead of the array buffer.

Modifying this to `val.buffer instanceof ArrayBuffer` now returns true which fixes the issue. This should work across devices.
Original author: @nick-michael

Co-authored-by: Nick Michael <[email protected]>
  • Loading branch information
tykus160 and nick-michael authored May 31, 2024
1 parent 8d680e5 commit 6f84e41
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/util/object_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ shaka.util.ObjectUtils = class {

// This covers Uint8Array and friends, even without a TypedArray
// base-class constructor.
const isTypedArray =
val.buffer && val.buffer.constructor == ArrayBuffer;
const isTypedArray = val.buffer instanceof ArrayBuffer;
if (isTypedArray) {
return val;
}
Expand Down

0 comments on commit 6f84e41

Please sign in to comment.