Skip to content

Commit

Permalink
proper fix for 1076305, throw exception, re #10602
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Feb 16, 2015
1 parent 98947f7 commit e62e0e2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Code/Mantid/Framework/DataHandling/src/ProcessDasNexusLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,10 @@ void ProcessDasNexusLog::convertToAbsoluteTime(
Kernel::Property *log = ws->run().getProperty(logname);
Kernel::TimeSeriesProperty<double> *tslog =
dynamic_cast<Kernel::TimeSeriesProperty<double> *>(log);
std::vector<Kernel::DateAndTime> times;
if (tslog)
times = tslog->timesAsVector();
if (!tslog)
throw std::runtime_error("Invalid time series log: it could not be cast "
"(interpreted) as a time series property");
std::vector<Kernel::DateAndTime> times = tslog->timesAsVector();
std::vector<double> values = tslog->valuesAsVector();

// 2. Get converted
Expand Down Expand Up @@ -447,9 +448,10 @@ void ProcessDasNexusLog::writeLogtoFile(API::MatrixWorkspace_sptr ws,
Kernel::Property *log = ws->run().getProperty(logname);
Kernel::TimeSeriesProperty<double> *tslog =
dynamic_cast<Kernel::TimeSeriesProperty<double> *>(log);
std::vector<Kernel::DateAndTime> times;
if (tslog)
tslog->timesAsVector();
if (!tslog)
throw std::runtime_error("Invalid time series log: it could not be cast "
"(interpreted) as a time series property");
std::vector<Kernel::DateAndTime> times = tslog->timesAsVector();
std::vector<double> values = tslog->valuesAsVector();

// 2. Write out
Expand Down

0 comments on commit e62e0e2

Please sign in to comment.