Check localStorage entry before using it