VE Lights undefined method

So I've been using this script to no problem for ages and suddenly just now I'm having this error when after beating the third boss and as I change to stage 4 in Moghunter's Stage Select.

Scripts 'Lights' line 1062: NoMethodError occured

undefined method '[]' for nil:NilClass

https://drive.google.com/folderview?id=0B5uvwXLAev89ZTVQRTd2T0EwQlk&usp=sharing

https://atelierrgss.wordpress.com/rgss3-stage-select/

EDIT: I think the reason is because the boss map has two torches while the stage 4 room you go into has none and this causes it to bug in the transition, I temporarily removed the torches and the error doesn't appear. How do I get this to work with the torches though?

Original thread: https://forums.rpgmakerweb.com/threads/ve-lights-undefined-method.46189/