From 476657ecad567e2850a53e75259e58c840a6a392 Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:12:30 -0400 Subject: [PATCH] undefined check for obj. descriptor --- src/openseadragon.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index 685ef10f..04184d4e 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1102,12 +1102,17 @@ function OpenSeadragon( options ){ // Extend the base object for ( name in options ) { var descriptor = Object.getOwnPropertyDescriptor(options, name); - if (descriptor.get || descriptor.set) { - Object.defineProperty(target, name, descriptor); - continue; - } - copy = descriptor.value; + if (descriptor !== undefined) { + if (descriptor.get || descriptor.set) { + Object.defineProperty(target, name, descriptor); + continue; + } + + copy = descriptor.value; + } else { + $.console.warn('Undefined descriptior obtained for the "' + name + '" property in extended object.'); + } // Prevent never-ending loop if ( target === copy ) {