encoding: Fixes in Block: using std::vector for subblocks and allowing block with empty value
Block will not throw exception and will encode an empty value wire if
underlying buffer has not been previously set.
Change-Id: Iabb545ac6383e5a35880fb446a8c9ba9409e5afd
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index fdeb043..0785ec0 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -226,6 +226,10 @@
Tlv::writeVarNumber(os, value_size());
os.write(reinterpret_cast<const char*>(value()), value_size());
}
+ else if (m_subBlocks.size() == 0)
+ {
+ Tlv::writeVarNumber(os, 0);
+ }
else
{
size_t valueSize = 0;