CodeLionX / actordb

Actor Database System Framework using Akka
MIT License
0 stars 2 forks source link

Record.get on an empty, i.e. null, field will return Some(null) instead of None #11

Closed srfc closed 6 years ago

srfc commented 6 years ago

Issue

Calling Record.get on a field that is contains null will return Some(null) instead of None, which causes a NPE problems e.g. in the RowRelation's where method.

Problem Description

A Record's field can be null if a field is not given a value using the withCellContent method for a field that it is initialised with using the proper column definition:

val record = Record(Seq(ColumnDef[Int]("id"))).build()
record.get[Int](ColumnDef[Int]("id")) // returns Some(null)

Operating on such a Some(null) using i.a. the exists method will cause a NPE.

Supporting Information

I will attempt to fix this by checking that the the field is not null in Record.get.