Difference in deleting POFU views in 8 from 7

I have an application in LN 7.0 in which I have two POFU views. Because they are small views and I want to make sure any programming changes always get updated, I delete the views when the user leaves the DB (code is in the QueryClose event of the Database script). This has run perfectly until I installed 8.0.2. Now when I exit the DB the program throws the old “Variant does not contain an object” error because there is nothing in the Readers field (see below). The only person having this problem is me, and I am running 8.0.2.

I have checked the documentation and cannot find any differences in how LN treats POFU views in 7 and 8; did I miss something?

'CalendarPOFU

Set view = db.GetView(“CalendarPOFU”)

If Not(view Is Nothing) Then

If view.readers(0)=s.UserName Then

  view.remove

End If

End If

Subject: Check all views by that name

Your database should have at least two views by that name - the template and your private view. It looks like you are only checking one of them.

It might be that your code was picking the Private view first, which is why it used to work, but is now picking the template view.

You should probably iterate through all database views, check their name to match the to the one you need, and then check if there’s a reader field that matches the current user.