Skip to content

Commit b5156d1

Browse files
fix: Handle falsy values in DescriptorType value property (Dash-Industry-Forum#4784)
1 parent 8f10117 commit b5156d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dash/vo/DescriptorType.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DescriptorType {
4444
init(data) {
4545
if (data) {
4646
this.schemeIdUri = data.schemeIdUri ? data.schemeIdUri : null;
47-
this.value = data.value ? data.value.toString() : null;
47+
this.value = data.value !== null && data.value !== undefined ? data.value.toString() : null;
4848
this.id = data.id ? data.id : null;
4949
// Only add the DVB extensions if they exist
5050
if (data[DashConstants.DVB_URL]) {
@@ -66,7 +66,7 @@ class DescriptorType {
6666
this.schemeIdUri === entry.schemeIdUri && (
6767
this.value ?
6868
(this.value.toString().match(entry.value)) : // check if provided value matches RegExp
69-
(''.match(entry.value)) // check if RegExp allows absent value
69+
(''.match(entry.value)) // check if RegExp allows absent value
7070
)
7171
);
7272
})

0 commit comments

Comments
 (0)