Add undefined check to 'document' variable in platform_utils

This commit is contained in:
spennihana 2023-08-16 21:48:16 -04:00
parent ed0c8d8d8b
commit 5e5dec07b0
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ mediapipe/provisioning_profile.mobileprovision
node_modules/
.configure.bazelrc
.user.bazelrc
.idea/

View File

@ -32,5 +32,5 @@ export function isIOS() {
// tslint:disable-next-line:deprecation
].includes(navigator.platform)
// iPad on iOS 13 detection
|| (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
|| (navigator.userAgent.includes('Mac') && (window.document !== undefined && 'ontouchend' in document));
}