2323using  System . IO ; 
2424using  System . Reflection ; 
2525
26+ #nullable enable
27+ 
2628namespace  OpenQA . Selenium . Internal 
2729{ 
2830    /// <summary> 
@@ -40,7 +42,7 @@ internal static class FileUtilities
4042        /// <returns><see langword="true"/> if the copy is completed; otherwise <see langword="false"/>.</returns> 
4143        public  static   bool  CopyDirectory ( string  sourceDirectory ,  string  destinationDirectory ) 
4244        { 
43-             bool  copyComplete   =   false ; 
45+             bool  copyComplete ; 
4446            DirectoryInfo  sourceDirectoryInfo  =  new  DirectoryInfo ( sourceDirectory ) ; 
4547            DirectoryInfo  destinationDirectoryInfo  =  new  DirectoryInfo ( destinationDirectory ) ; 
4648
@@ -132,7 +134,7 @@ public static string FindFile(string fileName)
132134
133135            // If it's not in the same directory as the executing assembly, 
134136            // try looking in the system path. 
135-             string  systemPath  =  Environment . GetEnvironmentVariable ( "PATH" ) ; 
137+             string ?  systemPath  =  Environment . GetEnvironmentVariable ( "PATH" ) ; 
136138            if  ( ! string . IsNullOrEmpty ( systemPath ) ) 
137139            { 
138140                string  expandedPath  =  Environment . ExpandEnvironmentVariables ( systemPath ) ; 
@@ -165,7 +167,7 @@ public static string FindFile(string fileName)
165167        public  static   string  GetCurrentDirectory ( ) 
166168        { 
167169            Assembly  executingAssembly  =  typeof ( FileUtilities ) . Assembly ; 
168-             string  location  =  null ; 
170+             string ?  location  =  null ; 
169171
170172            // Make sure not to call Path.GetDirectoryName if assembly location is null or empty 
171173            if  ( ! string . IsNullOrEmpty ( executingAssembly . Location ) ) 
@@ -184,13 +186,13 @@ public static string GetCurrentDirectory()
184186                location  =  Directory . GetCurrentDirectory ( ) ; 
185187            } 
186188
187-             string  currentDirectory  =  location ; 
189+             string  currentDirectory  =  location ! ; 
188190
189191            // If we're shadow copying, get the directory from the codebase instead 
190192            if  ( AppDomain . CurrentDomain . ShadowCopyFiles ) 
191193            { 
192194                Uri  uri  =  new  Uri ( executingAssembly . CodeBase ) ; 
193-                 currentDirectory  =  Path . GetDirectoryName ( uri . LocalPath ) ; 
195+                 currentDirectory  =  Path . GetDirectoryName ( uri . LocalPath ) ! ; 
194196            } 
195197
196198            return  currentDirectory ; 
0 commit comments