This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9077b8b03b fix(plc4go/spi): avoid npe on nested structs
9077b8b03b is described below

commit 9077b8b03b8e3b59df466a8ce01de8960c097788
Author: Sebastian Rühl <[email protected]>
AuthorDate: Tue Nov 19 10:32:11 2024 +0100

    fix(plc4go/spi): avoid npe on nested structs
---
 plc4go/spi/values/PlcStruct.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plc4go/spi/values/PlcStruct.go b/plc4go/spi/values/PlcStruct.go
index b06da8ca01..da35bed29a 100644
--- a/plc4go/spi/values/PlcStruct.go
+++ b/plc4go/spi/values/PlcStruct.go
@@ -103,7 +103,11 @@ func (m PlcStruct) GetString() string {
                sb.WriteString("  ")
                sb.WriteString(tagName)
                sb.WriteString(": \"")
-               sb.WriteString(tagValue.GetString())
+               if tagValue.IsString() {
+                       sb.WriteString(tagValue.GetString())
+               } else {
+                       sb.WriteString(fmt.Sprintf("%v", tagValue))
+               }
                sb.WriteString("\"\n")
        }
        sb.WriteString("}")

Reply via email to