Fix bulkDeleteDocsCollection errors

There are a couple of JS errors that occur when going to and from
the Views page. This just adds a check to confirm a var is really
available before using it.