From 600ba40571d330a764e1baa885c59e3b8553c1ac Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Fri, 4 Oct 2019 16:22:17 +0200
Subject: [PATCH] Correction on f_generateLocalResource to allow creation of
 container when no attributes are provided

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Functions.ttcn | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn
index 625a603..73d191e 100644
--- a/LibOneM2M/OneM2M_Functions.ttcn
+++ b/LibOneM2M/OneM2M_Functions.ttcn
@@ -3067,7 +3067,9 @@ module OneM2M_Functions {
 					}
 				} else if(p_resourceType == int3 and ispresent(p_resource)) { //Container
 					if(ischosen(p_resource.container)){
-						v_myResource.container := valueof(p_resource.container);
+						if(isvalue(p_resource.container)) {
+							v_myResource.container := valueof(p_resource.container);
+						}
 						v_myResource.container.resourceType := p_resourceType;
       					
 						v_myResource.container.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
-- 
GitLab