diff --git a/jquery.webcam.js b/jquery.webcam.js index ba9a945..3e23296 100644 --- a/jquery.webcam.js +++ b/jquery.webcam.js @@ -52,7 +52,7 @@ var cam = document.getElementById('XwebcamXobjectX'); - if (cam.capture !== undefined) { + if (cam && cam.capture !== undefined) { /* Simple callback methods are not allowed :-/ */ webcam.capture = function(x) {