diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py index b5778fa9c80e..0e2f74243792 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py @@ -328,16 +328,19 @@ def _get_temperature(self, ws_name): # Get temperature from log file LoadLog(Workspace=ws_name, Filename=log_path) run_logs = mtd[ws_name].getRun() - tmp = run_logs[self._sample_log_name].value - temp = tmp[len(tmp) - 1] - logger.debug('Temperature %d K found for run: %s' % (temp, run_name)) - return temp - + if self._sample_log_name in run_logs: + tmp = run_logs[self._sample_log_name].value + temp = tmp[len(tmp) - 1] + logger.debug('Temperature %d K found for run: %s' % (temp, run_name)) + return temp + else: + logger.warning('Log entry %s for run %s not found' % (self._sample_log_name, run_name)) else: - # Can't find log file logger.warning('Log file for run %s not found' % run_name) - logger.warning('No temperature found for run: %s' % run_name) - return None + + # Can't find log file + logger.warning('No temperature found for run: %s' % run_name) + return None # Register algorithm with Mantid