Skip to content

Commit 8c1f79b

Browse files
committed
fix: readability issue
1 parent 3487f40 commit 8c1f79b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/validations/is-multisite-domain-mapped.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const getPrimaryDomainFromSQL = ( statements: string[][] ): string => {
2121
}
2222

2323
const SQL_WP_SITE_DOMAINS_REGEX = /\(1,'([^']+)'/s;
24-
const matches = SQL_WP_SITE_DOMAINS_REGEX.exec( statements[ 0 ].join( '' ).replace( /\s/g, '' ) );
24+
const normalizedSql = statements[ 0 ]?.join( '' ).replace( /\s/g, '' ) ?? '';
25+
const matches = SQL_WP_SITE_DOMAINS_REGEX.exec( normalizedSql );
2526
return matches ? matches[ 1 ] : '';
2627
};
2728

0 commit comments

Comments
 (0)