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:
parent
b08b14f6bd
commit
6c29a553ec
@ -61,15 +61,10 @@ bool RicWellPathsImportSsihubFeature::isCommandEnabled()
|
||||
void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if (!app->project())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!app->project()) 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
|
||||
app->project()->computeUtmAreaOfInterest();
|
||||
@ -78,10 +73,12 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||
wellPathsFolderPath += "_wellpaths";
|
||||
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
|
||||
QString copyOfOriginalObject = app->project()->wellPathImport()->writeObjectToXmlString();
|
||||
|
||||
if (!app->preferences()) return;
|
||||
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, app->project()->wellPathImport(), RiuMainWindow::instance());
|
||||
|
||||
// Get password/username from application cache
|
||||
|
Loading…
Reference in New Issue
Block a user