I hava a function in a contract:
function getLastBidding() public view returns (Bidding) {
return biddings[biddings.length-1];
}
The problem is when the biddings
array is empty, it doesn't work, because I can't access index -1
. So, I would like to return some sort of null when the array is empty. What can I return instead?