mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4509 Guard access to gui application code in import and well path code to avoid crashes in console mode
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
@@ -173,11 +176,15 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
RimEclipseCase* mainCase = caseCollection()->reservoirs[0];
|
||||
if (!mainCase->openReserviorCase())
|
||||
{
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"Error when opening project file",
|
||||
"Could not open the Eclipse Grid file: \n"+ mainCase->gridFileName() + "\n"+
|
||||
"Current working directory is: \n" +
|
||||
QDir::currentPath());
|
||||
QString errorMessage = QString("Could not open the Eclipse Grid file: \n") + mainCase->gridFileName() + "\n" +
|
||||
"Current working directory is: \n" + QDir::currentPath();
|
||||
|
||||
if (RiaGuiApplication::isRunning())
|
||||
{
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"Error when opening project file", errorMessage);
|
||||
}
|
||||
RiaLogging::error(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user