Improved error handling.

This commit is contained in:
Martin Edenhofer 2015-07-17 09:12:23 +02:00
parent 2edeef76e1
commit 55fb0fedfe

View file

@ -30,7 +30,7 @@ module Ticket::Number::Increment
if config[:checksum] if config[:checksum]
min_digs = min_digs.to_i - 1 min_digs = min_digs.to_i - 1
end end
fillup = Setting.get('system_id') || '1' fillup = Setting.get('system_id').to_s || '1'
( 1..100 ).each { ( 1..100 ).each {
next if ( fillup.length.to_i + counter_increment.to_s.length.to_i ) >= min_digs.to_i next if ( fillup.length.to_i + counter_increment.to_s.length.to_i ) >= min_digs.to_i