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