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:
parent
9265fd8502
commit
167ccb784a
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user