Bug-612: Added check - before subobjects are serialized.

Change-Id: I1ec19c5529bc85c6dadb02f0e7979db447fcf48b
Signed-off-by: Milos Fabian <milfabia@cisco.com>