Bug: updateSourceCaches_() assumes srcObj has src and type properties
Severity: Low
Files: src/js/player.js
Lines: 1582-1585
Description
When srcObj is a non-string object, the code accesses srcObj.src and srcObj.type without checking if these properties exist. If srcObj is null, {}, or an object with different keys, src and type will be undefined, leading to silent failures.
Affected code
if (typeof src !== 'string') {
src = srcObj.src; // <-- Could be undefined
type = srcObj.type; // <-- Could be undefined
}
Suggested fix
if (typeof src !== 'string') {
src = srcObj?.src ?? '';
type = srcObj?.type ?? '';
}
Bug:
updateSourceCaches_()assumessrcObjhassrcandtypepropertiesSeverity: Low
Files:
src/js/player.jsLines: 1582-1585
Description
When
srcObjis a non-string object, the code accessessrcObj.srcandsrcObj.typewithout checking if these properties exist. IfsrcObjisnull,{}, or an object with different keys,srcandtypewill beundefined, leading to silent failures.Affected code
Suggested fix