소스 검색

Checking in right place

Piotr Czajkowski 22 시간 전
부모
커밋
e12cde0f56
1개의 변경된 파일과 6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      ProcessFiles/ProcessFiles.cs

+ 6 - 6
ProcessFiles/ProcessFiles.cs

@@ -19,6 +19,12 @@ namespace ProcessFiles
 
         private Result WhatIsIt(string path)
         {
+            if (!File.Exists(path))
+            {
+                errors.Add($"{path} doesn't exist!");
+                return Result.Failure;
+            }
+            
             try
             {
                 var attr = File.GetAttributes(path);
@@ -47,12 +53,6 @@ namespace ProcessFiles
 
         private bool IsValid(string path, string[] fileExtensions)
         {
-            if (!File.Exists(path))
-            {
-                errors.Add($"{path} doesn't exist!");
-                return false;
-            }
-
             var extension = GetExtension(path);
             if (extension == null)
                 return false;