Added a check in Modals.draw to prevent drawing in destroyed modals

Modals draw asynchronously which can sometimes result in a previously destroyed modal drawing after it has been destroyed. This should fix the "document is null" bug that sometimes occurs.