# HG changeset patch # User Jason Maltzen # Date 2015-12-31 05:50:21 # Node ID 8c3f6ec929d6b9fe3a93030581993ba94f3ed238 # Parent dabc07eb39e617c94084889b1ec7e5830d832d3a Fix an error with searching for application data directories diff --git a/FileUtils.cs b/FileUtils.cs --- a/FileUtils.cs +++ b/FileUtils.cs @@ -21,10 +21,9 @@ namespace DesertPaintLab System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "data", dirname); - if (!System.IO.Directory.Exists(dirPath)) + if (System.IO.Directory.Exists(dirPath)) { - // not found - dirPath = null; + return dirPath; } // try "Resources" in case this is a Mac app bundle dirPath = System.IO.Path.Combine( @@ -44,10 +43,10 @@ namespace DesertPaintLab System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Resources", "data", dirname); - if (!System.IO.Directory.Exists(dirPath)) + if (System.IO.Directory.Exists(dirPath)) { // not found - dirPath = null; + return dirPath; } dirPath = System.IO.Path.Combine( System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),