1.fix 当imageKnifeOption参数传入为undefined时,由于对undefined数据进行读取属性导致的crash问题

Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
zhoulisheng1 2023-03-24 10:40:27 +08:00
parent d77539c555
commit 48b4844ed7
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ export struct ImageKnifeComponent {
}
// imageknife 第一次启动和数据刷新后重新发送请求
imageKnifeExecute() {
if (this.imageKnifeOption.loadSrc == null) {
if (this.imageKnifeOption == null || this.imageKnifeOption.loadSrc == null) {
// 如果数据是null或者undefined,清空图片内容和gif循环并且不进入图片请求流程
this.resetGifData()
if (this.canvasHasReady) {