diff options
Diffstat (limited to 'tensorflow/core/platform/file_system.cc')
-rw-r--r-- | tensorflow/core/platform/file_system.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/core/platform/file_system.cc b/tensorflow/core/platform/file_system.cc index bb926b35b7..6532c0f81a 100644 --- a/tensorflow/core/platform/file_system.cc +++ b/tensorflow/core/platform/file_system.cc @@ -30,6 +30,10 @@ FileSystem::~FileSystem() {} string FileSystem::TranslateName(const string& name) const { return name; } Status FileSystem::IsDirectory(const string& name) { + // Check if path exists. + if (!FileExists(name)) { + return Status(tensorflow::error::NOT_FOUND, "Path not found"); + } FileStatistics stat; TF_RETURN_IF_ERROR(Stat(name, &stat)); if (S_ISDIR(stat.mode)) { |