Checked whether results available before processing
@@ -273,9 +273,11 @@ public class RDMBSConnector {
RETRIEVE_TASK_STATE)) {
preparedStatement.setString(1, taskName);
try (ResultSet resultSet = preparedStatement.executeQuery()) {
- resultSet.next();
+ if (resultSet.next()) {
return CoordinatedTask.States.valueOf(resultSet.getString(TASK_STATE));
}
+ return null;
+ }
} catch (SQLException ex) {
throw new TaskCoordinationException(ERROR_MSG, ex);
}
