From 036f3baf3aa519340d43e8d0a4a09d656e1bca4c Mon Sep 17 00:00:00 2001 From: Alexandra Goff Date: Wed, 8 Nov 2023 15:20:36 -0700 Subject: [PATCH] [C] check for window --- packages/epo-react-lib/package.json | 2 +- packages/epo-react-lib/src/lib/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/epo-react-lib/package.json b/packages/epo-react-lib/package.json index 9d2fb892..07350ea4 100644 --- a/packages/epo-react-lib/package.json +++ b/packages/epo-react-lib/package.json @@ -1,7 +1,7 @@ { "name": "@rubin-epo/epo-react-lib", "description": "Rubin Observatory Education & Public Outreach team React UI library.", - "version": "2.0.4", + "version": "2.0.5", "author": "Rubin EPO", "license": "MIT", "homepage": "https://lsst-epo.github.io/epo-react-lib", diff --git a/packages/epo-react-lib/src/lib/utils.ts b/packages/epo-react-lib/src/lib/utils.ts index 2cf30dae..eb42814f 100644 --- a/packages/epo-react-lib/src/lib/utils.ts +++ b/packages/epo-react-lib/src/lib/utils.ts @@ -73,11 +73,11 @@ export function isStyleSupported(prop: string, value: string): boolean { // If no value is supplied, use "inherit" value = arguments.length === 2 ? value : "inherit"; // Try the native standard method first - if ("CSS" in window && "supports" in window.CSS) { + if (window && "CSS" in window && "supports" in window.CSS) { return window.CSS.supports(prop, value); } // Check Opera's native method - if ("supportsCSS" in window) { + if (window && "supportsCSS" in window) { return (window.supportsCSS as (property: string, value: string) => boolean)( prop, value