From 2c7473f422707256ea47e29f499df22eabfb2893 Mon Sep 17 00:00:00 2001 From: zgf Date: Tue, 21 Jan 2025 15:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=ADloadSrc=E4=BC=A0=E5=85=A5pixe?= =?UTF-8?q?lmap=E7=B1=BB=E5=9E=8B=E5=A4=84=E5=A2=9E=E5=8A=A0=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgf --- CHANGELOG.md | 1 + library/src/main/ets/ImageKnifeDispatcher.ets | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f1962c..425ff9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix bug: CropTransformation is used to crop the original image - Fix bug: After calling the clear all file cache interfaces, the file cache becomes invalid - Optimize the efficiency of file cache initialization. +- Add protection at the location where loadSrc is passed in the pixelmap type ## 3.2.0 - When successfully requesting the network, return the httpcode as well diff --git a/library/src/main/ets/ImageKnifeDispatcher.ets b/library/src/main/ets/ImageKnifeDispatcher.ets index 2356a1c..bebdd22 100644 --- a/library/src/main/ets/ImageKnifeDispatcher.ets +++ b/library/src/main/ets/ImageKnifeDispatcher.ets @@ -51,7 +51,7 @@ export class ImageKnifeDispatcher { LogUtil.log('showFromMemomry.start:' + request.componentId + ',srcType:' + requestSource + ',version:' + request.componentVersion + ' isAnimator=' + isAnimator) let memoryCache: ImageKnifeData | undefined; let memoryCheckStartTime = Date.now(); - if ((typeof (request.imageKnifeOption.loadSrc as image.PixelMap).isEditable) == 'boolean') { + if ((typeof (request.imageKnifeOption.loadSrc as image.PixelMap)?.isEditable) == 'boolean') { memoryCache = { source: request.imageKnifeOption.loadSrc as image.PixelMap, imageWidth: 0,