Hey, this might be a common Problem, but I can't f...
# exposed
h
Hey, this might be a common Problem, but I can't find it via google. When I have Table A and Table B, B has a foreign key in A. Now I do a
A.leftJoin(B)
. Now from this joined Result set I want to map the fields, but when B has no corresponding row yet the fields are null (of course) and I get
Parameter specified as non-null is null
. But in the Table definition the field is not marked as nullable so IJ says
Unnecessary safe call on a non-null receiver
when I want to use
?.let { }
. What is the right way to handle this? It works perfectly fine with
?.let { }
, so just suppress the warning?
o
Hi, thank you for the mentioning that problem. Unfortunately, if I'm right, there is no way to guarantee that left joined rows will be nullable now. And I do not see any straightforward way how could it be fixed now. I created the issue EXPOSED-429 (Left joined columns are not nullable) and will try to think about how it could be fixed.
h
Thank you!