You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2021/04/14 13:20:54 UTC
[plc4x] 04/14: plc4go: when we try to box nil we just return an
empty string
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
commit 4ea6b3b8321741422ea5adbee91e26f166316cd4
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Apr 14 00:47:01 2021 +0200
plc4go: when we try to box nil we just return an empty string
---
plc4go/internal/plc4go/spi/utils/asciiBox.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plc4go/internal/plc4go/spi/utils/asciiBox.go b/plc4go/internal/plc4go/spi/utils/asciiBox.go
index 914adb2..698369a 100644
--- a/plc4go/internal/plc4go/spi/utils/asciiBox.go
+++ b/plc4go/internal/plc4go/spi/utils/asciiBox.go
@@ -49,6 +49,8 @@ type AsciiBoxer interface {
func BoxAnything(name string, anything interface{}, charWidth int) AsciiBox {
switch anything.(type) {
+ case nil:
+ return ""
case AsciiBoxer:
// A box usually has its own name
return anything.(AsciiBoxer).Box(name, charWidth)