fix for undefined resource_class

li.active depends on resource_class being defined, but that is apparently
not the case when one is not logged in. (This happens in one of our projects.)

Adding a simple test completely resolves the problem.