Skip to content

Commit f586bb7

Browse files
committed
chore: try to debug NaN in deployment
1 parent 4c7070b commit f586bb7

File tree

1 file changed

+2
-1
lines changed
  • packages/theme-generator/src/common/themes

1 file changed

+2
-1
lines changed

packages/theme-generator/src/common/themes/core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ export function generateBrandPalette(hex, remainInput = false) {
232232
});
233233

234234
const isTencentBlue = lowCaseHex === TENCENT_BLUE.toLowerCase();
235+
const validPrimary = typeof primary === 'number' && !isNaN(primary) ? primary : 6;
235236

236-
const lightBrandIdx = isTencentBlue ? 7 : primary + 1;
237+
const lightBrandIdx = isTencentBlue ? 7 : validPrimary + 1;
237238
const lightPalette = [...colors];
238239

239240
const darkPalette = isTencentBlue ? TENCENT_BLUE_DARK_PALETTE : [...colors].reverse();

0 commit comments

Comments
 (0)