[HOTFIX] Ignore invalid pages (not existing template)

I disagree with this. If a page does not have a valid template, then we have done something wrong, the system should not be in this state and an exception should be thrown.

Covering up errors like this will just lead to lazy code. The above command will not be executed. We will have an inconsistent database.