Skip to content

Commit

Permalink
fix(plc4go/spi): FieldReaderOptional nil fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Aug 31, 2024
1 parent 10f421a commit d92d1f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plc4go/spi/codegen/fields/FieldReaderVirtual.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func (f *FieldReaderVirtual[T]) ReadVirtualField(ctx context.Context, logicalNam
case *string:
return any(fmt.Sprintf("%v", valueExpression)).(T), nil
}
if valueExpression == nil {
return f.toT(nil, nil)
}
return valueExpression.(T), nil
}

Expand Down

0 comments on commit d92d1f3

Please sign in to comment.