Skip to content
Snippets Groups Projects
Commit 154cccbe authored by Steve Lhomme's avatar Steve Lhomme Committed by Alaric Senat
Browse files

fs: Directory: don't use char string if they are NULL

parent fce5e4d3
No related branches found
Tags 3.1.5
No related merge requests found
...@@ -174,8 +174,10 @@ void Directory::addFile( std::string mrl, fs::IFile::LinkedFileType linkedType, ...@@ -174,8 +174,10 @@ void Directory::addFile( std::string mrl, fs::IFile::LinkedFileType linkedType,
#ifdef _WIN32 #ifdef _WIN32
/* We can't use _wstat here, see #323 */ /* We can't use _wstat here, see #323 */
auto wpath = charset::ToWide( path.c_str() );
WIN32_FILE_ATTRIBUTE_DATA attributes; WIN32_FILE_ATTRIBUTE_DATA attributes;
if ( GetFileAttributesExW( charset::ToWide( path.c_str() ).get(), if ( !wpath ||
GetFileAttributesExW( wpath.get(),
GetFileExInfoStandard, &attributes ) == 0 ) GetFileExInfoStandard, &attributes ) == 0 )
{ {
LOG_ERROR( "Failed to get ", path, " attributes" ); LOG_ERROR( "Failed to get ", path, " attributes" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment