Skip to content

Commit

Permalink
fix: handle scenario when openedWindow.location is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstark committed Feb 28, 2025
1 parent 1bd646d commit fdca888
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const handleChildWindow = async <T>({
}
};

const isUrlOpened = openedWindow.location.href === url.toString();
const isUrlOpened =
openedWindow.location && openedWindow.location.href === url.toString();

if (!isUrlOpened) {
setWindowLocation();
Expand Down

0 comments on commit fdca888

Please sign in to comment.