Skip to content

Commit

Permalink
🐛 Fix conversion of primitives with NO type
Browse files Browse the repository at this point in the history
In case we have a resource without data, it also does not have a type.
We need to catch this to prevent the error: `cannot convert primitive with NO type information`

This happens, e.g., when we test for the exists of a file before doing anything else with the resource.

Partially-Fixes #957

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Aug 7, 2023
1 parent 2a2654a commit f99f9d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llx/data_conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ func (r *Result) RawData() *RawData {

data := &RawData{}
if r.Data != nil {
if r.Data.IsNil() {
// The type can be empty, when we do not have data
if r.Data.IsNil() || types.Type(r.Data.Type).IsEmpty() {
data.Type = types.Nil
} else {
data = r.Data.RawData()
Expand Down

0 comments on commit f99f9d4

Please sign in to comment.