Index: trunk/src/wp-includes/admin-bar.php
===================================================================
--- trunk/src/wp-includes/admin-bar.php	(revision 62282)
+++ trunk/src/wp-includes/admin-bar.php	(revision 62320)
@@ -972,6 +972,10 @@
 	$function = <<<'JS'
 		( applePattern, appleOSLabel ) => {
-			if ( ( new RegExp( applePattern ) ).test( navigator.userAgent ) ) {
-				document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' ).textContent = appleOSLabel;
+			if ( ! ( new RegExp( applePattern, 'i' ) ).test( navigator.userAgent ) ) {
+				return;
+			}
+			const kbd = document.querySelector( '#wp-admin-bar-command-palette .ab-label kbd' );
+			if ( kbd ) {
+				kbd.textContent = appleOSLabel;
 			}
 		}
