Fix dir check

It makes no sense here to return true if a directory is not a directory.
Another dir bool
Merge pull request #15903 from cachedout/mine_dir_check

Fix dir check