Unverified Commit cd667c8f authored by Austin Sanders's avatar Austin Sanders Committed by GitHub
Browse files

Update spice::readValue to throw an exception if no values are read (#5165)

* Modified spice::readValue to add check for numValuesRead

* Updated changelog

* Added an exception when no value is read in Spice::readValue
parent ab4483ec
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ release.
### Fixed
- Updated README.md to remove remaining references to downloading data from discontinued rsync server [#5152](https://github.com/DOI-USGS/ISIS3/issues/5152)
- Fixed users not being able to modify planetographic projections in qmos
- Modified spice::readValue to add check for numValuesRead to stop reading garbase values [#4928](https://github.com/USGS-Astrogeology/ISIS3/issues/4928)

## [7.2.0] - 2022-12-07

+7 −3
Original line number Diff line number Diff line
@@ -1118,7 +1118,7 @@ namespace Isis {
        gdpool_c(key.toLatin1().data(), (SpiceInt)index, 1,
                 &numValuesRead, &kernelValue, &found);

        if (found)
        if (found && numValuesRead > 0)
          result = kernelValue;
      }
      else if (type == SpiceStringType) {
@@ -1126,7 +1126,7 @@ namespace Isis {
        gcpool_c(key.toLatin1().data(), (SpiceInt)index, 1, sizeof(kernelValue),
                 &numValuesRead, kernelValue, &found);

        if (found)
        if (found && numValuesRead > 0)
          result = kernelValue;
      }
      else if (type == SpiceIntType) {
@@ -1134,7 +1134,7 @@ namespace Isis {
        gipool_c(key.toLatin1().data(), (SpiceInt)index, 1, &numValuesRead,
                 &kernelValue, &found);

        if (found)
        if (found && numValuesRead > 0)
          result = (int)kernelValue;
      }

@@ -1142,6 +1142,10 @@ namespace Isis {
        QString msg = "Can not find [" + key + "] in text kernels";
        throw IException(IException::Io, msg, _FILEINFO_);
      }
      else if (numValuesRead == 0){
        QString msg = "Found " + key + "] in text kernels, but no values were identified and read.";
        throw IException(IException::Io, msg, _FILEINFO_);
      }

      storeValue(key, index, type, result);
      NaifStatus::CheckErrors();