fix: prevent null access error when finding profile items

This commit is contained in:
Memory 2025-12-07 13:22:24 +08:00 committed by GitHub
parent b10075737f
commit 9863c1a1de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,7 @@ const ProfileCard: React.FC<Props> = (props) => {
id: 'profile'
})
const transform = tf ? { x: tf.x, y: tf.y, scaleX: 1, scaleY: 1 } : null
const info = items?.find((item) => item.id === current) ?? {
const info = items?.find((item) => item && item.id === current) ?? {
id: 'default',
type: 'local',
name: t('sider.cards.emptyProfile')