Skip to content

Commit 18a4310

Browse files
committed
bugfixes as identified by new test case #3
1 parent 1751297 commit 18a4310

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/dash/models/DashManifestModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ function DashManifestModel() {
10531053
}
10541054

10551055
const mainAS = getMainAdaptationSetForPreselection(preselection, adaptations);
1056-
return mainAS.Representation[0];
1056+
return (mainAS ? mainAS.Representation[0] : undefined);
10571057
}
10581058

10591059
function getPreselectionsForPeriod(voPeriod) {

test/unit/mocks/AdapterMock.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ function AdapterMock() {
246246
}
247247

248248
this.getCommonRepresentationForPreselection = function (preselection, adaptations) {
249-
const id = preselection.preselectionComponents.split(' ')[0]
250-
return adaptations.find((as) => as.id == id).Representation[0]
249+
const id = preselection.preselectionComponents.split(' ')[0];
250+
const as = adaptations.find((as) => as.id == id);
251+
return (as ? as.Representation[0] : undefined);
251252
}
252253

253254
}

test/unit/mocks/CapabilitiesMock.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class CapabilitiesMock {
4545
isCodecSupportedBasedOnTestedConfigurations() {
4646
return true;
4747
}
48+
49+
supportsEssentialProperty() {
50+
return true;
51+
}
4852
}
4953

5054
export default CapabilitiesMock;

0 commit comments

Comments
 (0)