Fixed compile error on 'empty' in OCRepresentation.cpp
authorErich Keane <erich.keane@intel.com>
Tue, 16 Dec 2014 18:30:31 +0000 (10:30 -0800)
committerErich Keane <erich.keane@intel.com>
Tue, 16 Dec 2014 18:30:31 +0000 (10:30 -0800)
The patch for fixing the 'empty' representation object issue
was incorrectly manually merged when it (review 633) was split from
the previous C++ unit test review.

Change-Id: Ib732e5dfcda6a6d34d072d5d93c363fd731912f6
Signed-off-by: Erich Keane <erich.keane@intel.com>
resource/src/OCRepresentation.cpp

index 6910baf..71487cd 100644 (file)
@@ -116,11 +116,6 @@ namespace OC
 
     std::string MessageContainer::getJSONRepresentation(OCInfoFormat f) const
     {
-        if(empty())
-        {
-            return "{}";
-        }
-
         std::stringstream os;
 
         // note: the block is required because cereal closes the JSON string
@@ -170,6 +165,11 @@ namespace OC
     { }
     std::string OCRepresentation::getJSONRepresentation() const
     {
+        if(empty())
+        {
+            return "{}";
+        }
+
         std::stringstream os;
 
         // note: the block is required because cereal closes the JSON string