Commit 8f73971c authored by David Thompson's avatar David Thompson
Browse files

Opening a non-existent filename should not crash.

Do not make further Exodus calls once `ex_open()` fails.
parent ab258f5b
......@@ -3847,6 +3847,12 @@ int vtkExodusIIReaderPrivate::OpenFile( const char* filename )
this->Exoid = ex_open( filename, EX_READ,
&this->AppWordSize, &this->DiskWordSize, &this->ExodusVersion );
if ( this->Exoid <= 0 )
{
vtkErrorMacro( "Unable to open \"" << filename << "\" for reading" );
return 0;
}
#ifdef VTK_USE_64BIT_IDS
// Set the exodus API to always return integer types as 64-bit
// without this call, large exodus files are not supported (which
......@@ -3860,12 +3866,6 @@ int vtkExodusIIReaderPrivate::OpenFile( const char* filename )
// in the ex_set_max_name_length() function.
ex_set_max_name_length(this->Exoid, this->Parent->GetMaxNameLength());
if ( this->Exoid <= 0 )
{
vtkErrorMacro( "Unable to open \"" << filename << "\" for reading" );
return 0;
}
vtkIdType numNodesInFile;
char dummyChar;
float dummyFloat;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment