adding missing condition for clearDir method

The "complete cache clear"-command throws a warning. That pull-request fixes it.