forked from floraachy/ImageKnife
1.fix 当loadSrc参数传入为undefined时,由于对undefined数据进行读取属性导致的crash问题
Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
parent
2f9c38c14f
commit
065abc6686
|
@ -251,6 +251,11 @@ export struct ImageKnifeComponent {
|
|||
}
|
||||
// imageknife 第一次启动和数据刷新后重新发送请求
|
||||
imageKnifeExecute() {
|
||||
if(this.imageKnifeOption.loadSrc == null){
|
||||
// 如果数据是null或者undefined 则不进入图片请求流程
|
||||
return
|
||||
}
|
||||
|
||||
this.resetGifData()
|
||||
let request = new RequestOption();
|
||||
this.configNecessary(request);
|
||||
|
@ -624,6 +629,7 @@ export struct ImageKnifeComponent {
|
|||
if (index >= frames.length) {
|
||||
index = 0;
|
||||
}
|
||||
// @ts-ignore
|
||||
this.gifTimerId = setTimeout(this.renderFrames.bind(this, frames, index, context, compWidth, compHeight), delayTime)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue