Guard nullpointer access and catch exceptions

This commit is contained in:
Magne Sjaastad 2021-06-14 08:01:28 +02:00
parent 60dbb8a715
commit 1350c56eaf
2 changed files with 2885 additions and 2890 deletions

View File

@ -718,7 +718,7 @@ QList<caf::PdmOptionItemInfo>
} }
if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_eclipseCase && if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_eclipseCase &&
m_eclipseCase->eclipseCaseData()->hasFractureResults() ) m_eclipseCase->eclipseCaseData() && m_eclipseCase->eclipseCaseData()->hasFractureResults() )
{ {
// Flow diagnostics is not supported for dual porosity models // Flow diagnostics is not supported for dual porosity models
continue; continue;

View File

@ -18,26 +18,9 @@
#include "RimVfpTableExtractor.h" #include "RimVfpTableExtractor.h"
// #include "RiaApplication.h"
// #include "RimCase.h"
// #include "RimEclipseCase.h"
// #include "RimGeoMechCase.h"
// #include "RimOilField.h"
// #include "RimProject.h"
// #include "RimWellLogFile.h"
// #include "RimWellPath.h"
// #include "RimWellPathCollection.h"
#include "cafPdmUiItem.h" #include "cafPdmUiItem.h"
#include "cafUtils.h" #include "cafUtils.h"
// #include <QDateTime>
// #include <QDir>
// #include <QFileInfo>
// #include "opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp"
// #include "opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp"
#include "opm/parser/eclipse/Parser/Parser.hpp" #include "opm/parser/eclipse/Parser/Parser.hpp"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -47,6 +30,8 @@ std::vector<Opm::VFPInjTable> RimVfpTableExtractor::extractVfpInjectionTables( c
{ {
std::vector<Opm::VFPInjTable> tables; std::vector<Opm::VFPInjTable> tables;
try
{
Opm::Parser parser; Opm::Parser parser;
auto deck = parser.parseFile( filename ); auto deck = parser.parseFile( filename );
@ -62,6 +47,10 @@ std::vector<Opm::VFPInjTable> RimVfpTableExtractor::extractVfpInjectionTables( c
Opm::VFPInjTable table( *kw, unitSystem ); Opm::VFPInjTable table( *kw, unitSystem );
tables.push_back( table ); tables.push_back( table );
} }
}
catch ( ... )
{
}
return tables; return tables;
} }
@ -73,6 +62,8 @@ std::vector<Opm::VFPProdTable> RimVfpTableExtractor::extractVfpProductionTables(
{ {
std::vector<Opm::VFPProdTable> tables; std::vector<Opm::VFPProdTable> tables;
try
{
Opm::Parser parser; Opm::Parser parser;
auto deck = parser.parseFile( filename ); auto deck = parser.parseFile( filename );
@ -88,6 +79,10 @@ std::vector<Opm::VFPProdTable> RimVfpTableExtractor::extractVfpProductionTables(
Opm::VFPProdTable table( *kw, unitSystem ); Opm::VFPProdTable table( *kw, unitSystem );
tables.push_back( table ); tables.push_back( table );
} }
}
catch ( ... )
{
}
return tables; return tables;
} }