Skip to content

Commit

Permalink
chore(Demo): Ignore errors when using keySystemsMapping in the console (
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Dec 24, 2024
1 parent fe94b6b commit 2cea8d3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,15 +1109,19 @@ shakaDemo.Main = class {
getValueFromGivenConfig_(valueName, configObject) {
let objOn = configObject;
let valueNameOn = valueName;
while (valueNameOn) {
// Split using a regex that only matches the first period.
const split = valueNameOn.split(/\.(.+)/);
if (split.length == 3) {
valueNameOn = split[1];
objOn = objOn[split[0]];
} else {
return objOn[split[0]];
try {
while (valueNameOn) {
// Split using a regex that only matches the first period.
const split = valueNameOn.split(/\.(.+)/);
if (split.length == 3) {
valueNameOn = split[1];
objOn = objOn[split[0]];
} else {
return objOn[split[0]];
}
}
} catch (e) {
// Ignore errors
}
return undefined;
}
Expand Down

0 comments on commit 2cea8d3

Please sign in to comment.