[#1251] Fix problem when calling resource_views_list without a resource

It would've been better to use `resource.has_views`, as this is the intent of
that variable, but unfortunately that's not possible here.