path.resolved_path_exists? may throw exception in brew doctor and brew prune, if null character included in the symlink (and perhaps under other conditions).  Handle that by trapping the exception and considering an exception thrown by resolved_path_exists? as evidence that the path is bad and needs to be pruned.  In the absense of this fix, both brew doctor and brew prune throw an exception that results in the user seeing a stack trace (along with a request to report the bug)