mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1882 Well paths: Guard pointers
This commit is contained in:
@@ -61,15 +61,10 @@ bool RicWellPathsImportSsihubFeature::isCommandEnabled()
|
|||||||
void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
if (!app->project())
|
if (!app->project()) return;
|
||||||
{
|
|
||||||
return;
|
if (!caf::Utils::fileExists(app->project()->fileName())) return;
|
||||||
}
|
|
||||||
|
|
||||||
if (!caf::Utils::fileExists(app->project()->fileName()))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the UTM bounding box from the reservoir
|
// Update the UTM bounding box from the reservoir
|
||||||
app->project()->computeUtmAreaOfInterest();
|
app->project()->computeUtmAreaOfInterest();
|
||||||
@@ -78,10 +73,12 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
|||||||
wellPathsFolderPath += "_wellpaths";
|
wellPathsFolderPath += "_wellpaths";
|
||||||
QDir::root().mkpath(wellPathsFolderPath);
|
QDir::root().mkpath(wellPathsFolderPath);
|
||||||
|
|
||||||
|
if (!app->project()->wellPathImport()) return;
|
||||||
|
|
||||||
// Keep a copy of the import settings, and restore if cancel is pressed in the import wizard
|
// Keep a copy of the import settings, and restore if cancel is pressed in the import wizard
|
||||||
QString copyOfOriginalObject = app->project()->wellPathImport()->writeObjectToXmlString();
|
QString copyOfOriginalObject = app->project()->wellPathImport()->writeObjectToXmlString();
|
||||||
|
|
||||||
|
if (!app->preferences()) return;
|
||||||
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, app->project()->wellPathImport(), RiuMainWindow::instance());
|
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, app->project()->wellPathImport(), RiuMainWindow::instance());
|
||||||
|
|
||||||
// Get password/username from application cache
|
// Get password/username from application cache
|
||||||
|
|||||||
Reference in New Issue
Block a user