From 664f2f6f2024fdf8cf055147154fb9dce9bbfd32 Mon Sep 17 00:00:00 2001
From: Amy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Date: Mon, 18 Mar 2024 13:59:29 -0700
Subject: [PATCH] Fixes match cube default to NULL (#5429)

---
 CHANGELOG.md                         | 1 +
 isis/src/base/apps/noproj/noproj.cpp | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c32a0a7cb..11a401c665 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,6 +44,7 @@ release.
 - Fixed <i>noproj</i> bug where some temporary files were not deleted after call to cam2cam.  Issue: [#4813](https://github.com/USGS-Astrogeology/ISIS3/issues/4813)
 - Fixed <i>noproj</i> bug where missing shapemodel-related keywords (RayTraceEngine, BulletParts, Tolerance) are dropped when the output label is created. This resulted in the Bullet collision detection engine not being used. Issue: [#5377](https://github.com/USGS-Astrogeology/ISIS3/issues/5377)
 - Fixed ISIS failing to expand env variables with an "_" in them. [#5402](https://github.com/DOI-USGS/ISIS3/pull/5402)
+- Fixed <i>noproj</i> bug where match cube not NULL when not specifying MATCH parameter [#5381](https://github.com/USGS-Astrogeology/ISIS3/issues/5381)
 
 ### Added
 - Added 8 new functions to the Sensor Utility Library: Slant Distance, Target Center Distance, Right Ascension Declination, Local Solar Time, Line Resolution, Sample Resolution, Pixel Resolution, and Solar Longitude.
diff --git a/isis/src/base/apps/noproj/noproj.cpp b/isis/src/base/apps/noproj/noproj.cpp
index 746b8395b6..c764b7f448 100644
--- a/isis/src/base/apps/noproj/noproj.cpp
+++ b/isis/src/base/apps/noproj/noproj.cpp
@@ -46,12 +46,12 @@ namespace Isis {
     }
     icube.open(ui.GetCubeName("FROM"));
 
-    Cube mcube;
+    Cube *mcube = NULL;
     if((ui.WasEntered("MATCH"))) {
-      mcube.open(ui.GetCubeName("MATCH"));
+      mcube->open(ui.GetCubeName("MATCH"));
     }
     
-    noproj(&icube, &mcube, ui);
+    noproj(&icube, mcube, ui);
   }
 
   /**
-- 
GitLab