tizen 2.4 release
[framework/security/key-manager.git] / src / manager / dpl / db / src / sql_connection.cpp
index e71918d..7214a73 100644 (file)
@@ -629,13 +629,13 @@ boost::optional<RawBuffer> SqlConnection::DataCommand::GetColumnOptionalBlob(
     }
     const unsigned char *value = reinterpret_cast<const unsigned char*>(
             sqlcipher3_column_blob(m_stmt, column));
+    if (!value) {
+        return boost::optional<RawBuffer>();
+    }
 
     int length = sqlcipher3_column_bytes(m_stmt, column);
     LogPedantic("Got blob of length: " << length);
 
-    if (!value)
-        return boost::optional<RawBuffer>();
-
     RawBuffer temp(value, value + length);
     return boost::optional<RawBuffer>(temp);
 }