Skip to content

Commit

Permalink
[C] check for window
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Nov 8, 2023
1 parent 84825e3 commit 036f3ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/epo-react-lib/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/epo-react-lib/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 036f3ba

Please sign in to comment.