From cae8ed276799f0171aa8a5d77b908b4a751c98e9 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 15 Feb 2020 12:32:45 -0500 Subject: Use Array.isArray instead of hasOwn --- ext/bg/js/audio.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js index 6389528b..0ecfd5c4 100644 --- a/ext/bg/js/audio.js +++ b/ext/bg/js/audio.js @@ -168,10 +168,8 @@ async function audioInject(definition, fields, sources, optionsContext) { } try { - let audioSourceDefinition = definition; - if (hasOwn(definition, 'expressions')) { - audioSourceDefinition = definition.expressions[0]; - } + const expressions = definition.expressions; + const audioSourceDefinition = Array.isArray(expressions) ? expressions[0] : definition; const {url} = await audioGetFromSources(audioSourceDefinition, sources, optionsContext, true); if (url !== null) { -- cgit v1.2.3