var state = document.getElementById(id_image).src;
id_image contains a specific ID of an image file that I'm looking for. The result should return the image URL.
Uncaught TypeError: Cannot read property 'src' of null
Can anybody suggest a way around this? I've tried the usual methods of checking if it's null or undefined but all that happens is that the check generates the same error instead. Is there a way to catch the above error cleanly?