Skip to content
This repository was archived by the owner on Aug 25, 2022. It is now read-only.

Commit f095db6

Browse files
committed
Merge pull request #8 from RichardVanDerMeer/master
Added check for 'this.settings.image'
2 parents 563e7d8 + df4bc81 commit f095db6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

wScratchPad.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@
203203
{
204204
if(this.settings.overlay != 'none')
205205
{
206-
this.drawImage(this.settings.image);
206+
if(this.settings.image)
207+
{
208+
this.drawImage(this.settings.image);
209+
}
207210
this.ctx.globalCompositeOperation = this.settings.overlay;
208211
}
209212
else
@@ -231,7 +234,10 @@
231234

232235
setBgImage: function()
233236
{
234-
this.sp.css({backgroundImage: 'url('+this.settings.image+')'});
237+
if(this.settings.image)
238+
{
239+
this.sp.css({backgroundImage: 'url('+this.settings.image+')'});
240+
}
235241
},
236242

237243
drawImage: function(imagePath)

0 commit comments

Comments
 (0)