File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class MatomoClient implements AnalyticsClient {
3333 action_name : pageTitle ,
3434 url : this . getAnalyticsURL ( ) ,
3535 [ CPU_DIMENSION_KEY ] : getShortCpuDescription (
36- this . environment . cpu [ 0 ] ?. model || ''
36+ this . environment . cpu [ 0 ] ?. model
3737 ) ,
3838 [ RAM_DIMENSION_KEY ] : formattedBytesToSize ( this . environment . ram ) ,
3939 [ VERSION_DIMENSION_KEY ] : this . environment . version ,
Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ const amdRyzenRegex = /AMD Ryzen ([0-9]+)/;
44const amdARegex = / A M D A ( [ 0 - 9 ] + ) / ;
55const otherAmdCpuRegex = / A M D ( [ A - Z a - z ] [ A - Z a - z \s ] * [ A - Z a - z ] | [ A - Z a - z ] ) [ \s | ( - ] / ;
66
7- export const getShortCpuDescription = ( cpu : string ) : string => {
7+ export const getShortCpuDescription = ( cpu : string | undefined ) : string => {
8+ if ( ! cpu ) {
9+ return 'Other' ;
10+ }
11+
812 if ( cpu . includes ( 'Apple' ) ) {
913 return cpu ;
1014 }
You can’t perform that action at this time.
0 commit comments