# HG changeset patch # User IBBoard # Date 1230295532 0 # Node ID b9346894319c47cfd5a4054d5cfcc347a5479f95 # Parent 163b35f875efa910ca6cd0f245ae86e23c469d4b Fixes #6 - Stop missing data folder being fatal * Add check that directory exists before trying to get file list * Add warning message if directory doesn't exist diff -r 163b35f875ef -r b9346894319c api/WarFoundryLoader.cs --- a/api/WarFoundryLoader.cs Fri Dec 26 12:32:16 2008 +0000 +++ b/api/WarFoundryLoader.cs Fri Dec 26 12:45:32 2008 +0000 @@ -159,11 +159,18 @@ foreach (DirectoryInfo directory in directories) { - LogNotifier.Debug(GetType(), "Load from "+directory.FullName); + if (directory.Exists) + { + LogNotifier.Debug(GetType(), "Load from "+directory.FullName); - foreach (FileInfo file in directory.GetFiles()) + foreach (FileInfo file in directory.GetFiles()) + { + LoadFile(file); + } + } + else { - LoadFile(file); + LogNotifier.WarnFormat(GetType(), "Load for {0} failed because directory didn't exist", directory.FullName); } }