Skip to content

Commit

Permalink
Should not call inputs if not used. Refs #8126.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Oct 25, 2013
1 parent 967b640 commit fc2511f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,20 @@ namespace Mantid
bool queryDataset = false;

// Format the timestamps in order to compare them.
std::string startDate = formatDateTime(inputs.getStartDate(), "%F %T");
std::string endDate = formatDateTime(inputs.getEndDate(), "%F %T");
std::string startDate;
std::string endDate;

// Investigation startDate if endDate is not selected
if (inputs.getStartDate() != 0 && inputs.getEndDate() == 0)
{
startDate = formatDateTime(inputs.getStartDate(), "%F %T");
investigationWhere.push_back("startDate >= '" + startDate + "'");
}

// Investigation endDate if startdate is not selected
if (inputs.getEndDate() != 0 && inputs.getStartDate() == 0)
{
endDate = formatDateTime(inputs.getEndDate(), "%F %T");
investigationWhere.push_back("endDate <= '" + endDate + "'");
}

Expand Down

0 comments on commit fc2511f

Please sign in to comment.