Fix a warning when the stockpile array is empty.