Skip to content

Commit ccd8511

Browse files
committed
Adding check for directory existence to prevent exception on windows
1 parent b5e56c3 commit ccd8511

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Runtime/SaveLoadUtility.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ public static object Load(System.Type objectType, ISerializationMethod serializa
108108
public static IEnumerable<string> EnumerateSavedFiles(string folderName = null, string baseFolderPath = null)
109109
{
110110
var savePath = GetSavePath(folderName,baseFolderPath);
111+
112+
//If directory does not exist we're done
113+
if (!Directory.Exists(savePath))
114+
{
115+
yield break;
116+
}
117+
111118
foreach ( var file in Directory.EnumerateFiles(savePath,"*",SearchOption.AllDirectories) )
112119
{
113120
yield return Path.GetFileName(file);

0 commit comments

Comments
 (0)