diff --git a/src/hx/libs/std/Sys.cpp b/src/hx/libs/std/Sys.cpp index 30ad2e29c..371addf93 100644 --- a/src/hx/libs/std/Sys.cpp +++ b/src/hx/libs/std/Sys.cpp @@ -669,7 +669,7 @@ Array _hx_std_sys_read_dir( String p ) const wchar_t *path = p.wchar_str(); size_t len = wcslen(path); if (len>MAX_PATH) - return null(); + hx::Throw(HX_CSTRING("Invalid directory")); WIN32_FIND_DATAW d; HANDLE handle; @@ -698,7 +698,7 @@ Array _hx_std_sys_read_dir( String p ) if( handle == INVALID_HANDLE_VALUE ) { hx::ExitGCFreeZone(); - return null(); + hx::Throw(HX_CSTRING("Invalid directory")); } while( true ) {