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 2022/09/29 11:03:15 UTC

[plc4x] branch develop updated: fix(plc4go/asciibox): fix npe one empty writer

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 8deea7be5 fix(plc4go/asciibox): fix npe one empty writer
8deea7be5 is described below

commit 8deea7be59d54b639d71463ac83313609e7e3951
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Sep 29 13:02:07 2022 +0200

    fix(plc4go/asciibox): fix npe one empty writer
---
 plc4go/spi/utils/WriteBufferBoxBased.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plc4go/spi/utils/WriteBufferBoxBased.go b/plc4go/spi/utils/WriteBufferBoxBased.go
index 610605b19..29332b97d 100644
--- a/plc4go/spi/utils/WriteBufferBoxBased.go
+++ b/plc4go/spi/utils/WriteBufferBoxBased.go
@@ -72,6 +72,9 @@ type boxedWriteBuffer struct {
 
 func (b *boxedWriteBuffer) GetBox() AsciiBox {
 	back := b.Back()
+	if back == nil {
+		return AsciiBox{}
+	}
 	return back.Value.(AsciiBox)
 }