dbf icon indicating copy to clipboard operation
dbf copied to clipboard

no implicit conversion of nil into String

Open doconnor-clintel opened this issue 7 months ago • 0 comments

Basically the same kind of issue as #90 and https://github.com/infused/dbf/pull/91

The comment on that PR is:

As of 4.1.3 a DBF::NoColumnsDefined error will be raised when attempting to read records if no columns are defined

However, we see:

no implicit conversion of nil into String
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `initialize'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `new'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `initialize'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:191:in `new'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:191:in `record'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `block in each'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `times'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `each'
/var/www/careright/releases/20231212045615/app/models/lookup.rb:506:in `import!'

Ideally, instantiating a record with data: nil would raise an argument error or similar, and reading a table + trying to instantiate a record wouldn't occur if it wasn't valid OR it raises a meaningful exception.

DBF Data: Can't attach here unfortunately (licencing). I suspect we're managing to pass in nulls/invalid data/etc.

doconnor-clintel avatar Dec 12 '23 06:12 doconnor-clintel