Fix file-not-found exception

This commit is contained in:
Flamefire committed 2013-10-18 21:29:43 +02:00
1 parent 4dd9f44f3d
commit 155718456c
1 file changed
+6 -4
+6 -4
View File
@@ -69,7 +69,7 @@ namespace VocaluxeLib
public static int TryReadInt(StreamReader sr) public static int TryReadInt(StreamReader sr)
{ {
string value = String.Empty; string value = String.Empty;
try try
{ {
int tmp = sr.Peek(); int tmp = sr.Peek();
@@ -79,7 +79,7 @@ namespace VocaluxeLib
if (sr.EndOfStream) if (sr.EndOfStream)
break; break;
char chr = (char)sr.Read(); var chr = (char)sr.Read();
value += chr.ToString(); value += chr.ToString();
tmp = sr.Peek(); tmp = sr.Peek();
} }
@@ -141,8 +141,10 @@ namespace VocaluxeLib
public static List<string> ListFiles(string path, string cast, bool recursive = false, bool fullpath = false) public static List<string> ListFiles(string path, string cast, bool recursive = false, bool fullpath = false)
{ {
List<string> files = new List<string>(); var files = new List<string>();
DirectoryInfo dir = new DirectoryInfo(path); var dir = new DirectoryInfo(path);
if (!dir.Exists)
return files;
try try
{ {