make sure the check doesn't blow up
This commit is contained in:
parent
43f642a8fe
commit
ced55552da
1 changed files with 16 additions and 12 deletions
|
@ -22,6 +22,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function safariVersionCheck(ua) {
|
function safariVersionCheck(ua) {
|
||||||
|
try {
|
||||||
const safariVersionMatch = ua.match(/Mac OS X ([\d|_]+).*Version\/([\d|\.]+) Safari/);
|
const safariVersionMatch = ua.match(/Mac OS X ([\d|_]+).*Version\/([\d|\.]+) Safari/);
|
||||||
if (safariVersionMatch) {
|
if (safariVersionMatch) {
|
||||||
const macOSVersionStr = safariVersionMatch[1];
|
const macOSVersionStr = safariVersionMatch[1];
|
||||||
|
@ -35,6 +36,9 @@ function safariVersionCheck(ua) {
|
||||||
`supported: ${colrFontSupported}`);
|
`supported: ${colrFontSupported}`);
|
||||||
return colrFontSupported;
|
return colrFontSupported;
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Couldn't determine Safari version to check COLR font support, assuming no.", err);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue