Fix bad reference when image picker is canceled (#1598)
parent
fd5bbb2769
commit
001b29a7e3
|
@ -174,6 +174,9 @@ export function UserAvatar({
|
||||||
aspect: [1, 1],
|
aspect: [1, 1],
|
||||||
})
|
})
|
||||||
const item = items[0]
|
const item = items[0]
|
||||||
|
if (!item) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const croppedImage = await openCropper(store, {
|
const croppedImage = await openCropper(store, {
|
||||||
mediaType: 'photo',
|
mediaType: 'photo',
|
||||||
|
|
|
@ -69,6 +69,9 @@ export function UserBanner({
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const items = await openPicker()
|
const items = await openPicker()
|
||||||
|
if (!items[0]) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
onSelectNewBanner?.(
|
onSelectNewBanner?.(
|
||||||
await openCropper(store, {
|
await openCropper(store, {
|
||||||
|
|
Loading…
Reference in New Issue