lib/rspreadsheet/xml_tied.rb in rspreadsheet-0.2.10 vs lib/rspreadsheet/xml_tied.rb in rspreadsheet-0.2.11
- old
+ new
@@ -94,10 +94,11 @@
end
# vrátí item na souřadnici aindex
def subitem(aindex)
aindex = aindex.to_i
if aindex.to_i<=0
- nil # TODO> maybe optionally raise 'Item index should be greater then 0'
+ raise 'Item index should be greater then 0' if Rspreadsheet.raise_on_negative_coordinates
+ nil
else
@itemcache[aindex] ||= prepare_subitem(aindex)
end
end