Check if _nodes is empty or not in output(). To get the output result,
_nodes must not be empty. In addition, use _nodes.back() instead of
nodes[nodes.size() - 1] for cleanup.
Change-Id: I22a085578a2fcba36d97685434fd6188ece60b66
Signed-off-by: Inki Dae <inki.dae@samsung.com>
vector<shared_ptr<BaseResultType> > &TaskManager::output()
{
- auto lastNode = _nodes[_nodes.size() - 1];
+ if (_nodes.empty()) {
+ SINGLEO_LOGE("Node is not set");
+ throw InvalidOperation("Node is not set");
+ }
+
+ auto lastNode = _nodes.back();
_results.clear();