Skip to content

Commit

Permalink
fix: 参数异常时抛出异常,防止黑屏 (#9925)
Browse files Browse the repository at this point in the history
Co-authored-by: tony chen <[email protected]>
  • Loading branch information
iChengbo and zhiqingchen authored Jul 30, 2021
1 parent 2185e15 commit 7867e68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/taro-rn/src/lib/previewImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export function previewImage(obj: Taro.previewImage.Option): void {
complete
}: any = obj || {}
const index = urls.indexOf(current)
if (index === -1) {
throw new Error('"current" or "urls" is invalid')
}
let sibling
function onSwipeDown() {
sibling?.destroy()
Expand Down

0 comments on commit 7867e68

Please sign in to comment.