js: Fix crash when page model is deleted