1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

ImageStim: Prevent unhandled exception when setting image to undefined

This commit is contained in:
jalfje 2025-03-27 19:56:05 -07:00 committed by GitHub
parent 9265fd8502
commit 167ccb784a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,7 +194,7 @@ export class ImageStim extends util.mix(VisualStim).with(ColorMixin)
}
const existingImage = this.getImage();
const hasChanged = existingImage ? existingImage.src !== image.src : true;
const hasChanged = existingImage && image ? existingImage.src !== image.src : existingImage || image;
this._setAttribute("image", image, log);