Devmode entry variable NULL When I'm using devmode to dump out a twig variable the site will no longer work saying that entry = NULL.

This only happens when I have some twig logic at the top of my template e.g.

    {% set metaDescription = entry.metaDescription %}
    {% set metaPageTitle = entry.metaPageTitle %}


do I need to move this logic elsewhere in order for devMode to work?
This is because I was on a category page not an entry page, so the entry variable didn't exist!