Commit 287f0c04 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Fixed issue with segfault occuring when right clicking a cnet in the project...

Fixed issue with segfault occuring when right clicking a cnet in the project tree when thre is only 1 cnet imported and no images imported. Fixes #5160.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@8254 41f8697f-d340-4b68-9986-7bafba869bb8
parent 4c5354c3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1557,11 +1557,14 @@ namespace Isis {
   *   @history 2016-06-23 Tracie Sucharski - Original version.
   *   @history 2017-05-17 Tracie Sucharski - If no active control set & there is only one control
   *                          in the project, default to that control.
   *   @history 2017-10-16 Ian Humphrey - Check to make sure we have imported images before trying
   *                           to set an active control when there is only one control in the
   *                           project. Fixes #5160.
   */
  Control *Project::activeControl() {

    if (!m_activeControl && m_controls->count() == 1) {
      if (m_controls->at(0)->count() == 1) {
      if (m_controls->at(0)->count() == 1 && m_images->count() > 1) {
        QString controlName = m_controls->at(0)->at(0)->displayProperties()->displayName();
        setActiveControl(controlName);
      }
+3 −0
Original line number Diff line number Diff line
@@ -174,6 +174,9 @@ namespace Isis {
   *                           addTemplateFolder(), templateRoot(), and m_templates as well as
   *                           serialization and structure for importing template filenames
   *                           Fixes #5086.
   *   @history 2017-10-16 Ian Humphrey - Modified activeControl() to check if any images have been
   *                           imported into the project before trying to set an active control
   *                           when there is only one control in the project. Fixes #5160.
   */
  class Project : public QObject {
    Q_OBJECT