I have function, that goes to return and delete last element from array, but if I delete this element, function could return null value
function poll(Queue storage _queue) public returns(Job job) {
require(data.length==0);
require(_queue.length - 1 < cursorPosition);
_queue.cursorPosition++;
// there should be element deleting
return (_queue.jobArray[cursorPosition - 1]);
}