Browse Source

Avoid IOException

杨博 (Yang Bo) 11 years ago
parent
commit
ba5c2ba80d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      std/java/_std/sys/FileSystem.hx

+ 6 - 1
std/java/_std/sys/FileSystem.hx

@@ -61,7 +61,12 @@ class FileSystem {
 
 	public static function fullPath( relPath : String ) : String
 	{
-		return new File(relPath).getCanonicalPath();
+		try {
+			return new File(relPath).getCanonicalPath();
+		} catch (e: java.io.IOException) {
+			throw new java.lang.RuntimeException(e);
+			return null;
+		}
 	}
 
 	public static function absPath ( relPath : String ) : String {