@skyux/core 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2965,10 +2965,18 @@
2965
2965
  var regex = /(auto|scroll)/;
2966
2966
  var windowObj = this.windowRef.nativeWindow;
2967
2967
  var bodyObj = windowObj.document.body;
2968
+ /* Sanity check */
2969
+ if (!element) {
2970
+ return windowObj;
2971
+ }
2968
2972
  var style = windowObj.getComputedStyle(element);
2969
2973
  var parent = element;
2970
2974
  do {
2971
2975
  parent = parent.parentNode;
2976
+ /* Sanity check for if this function is called for an element which has been removed from the DOM */
2977
+ if (!(parent instanceof HTMLElement)) {
2978
+ return windowObj;
2979
+ }
2972
2980
  style = windowObj.getComputedStyle(parent);
2973
2981
  } while (!regex.test(style.overflow) &&
2974
2982
  !regex.test(style.overflowY) &&