diff --git a/modules/conop/src/compound_lib.cc b/modules/conop/src/compound_lib.cc
index 215b75ad5e482c9cd6d7e51a11f8946cad8a48bf..c423e0a12155e8be67180a8ddc46e96f2f39db86 100644
--- a/modules/conop/src/compound_lib.cc
+++ b/modules/conop/src/compound_lib.cc
@@ -359,7 +359,9 @@ CompoundPtr CompoundLib::FindCompound(const String& id,
       }
       if (name_available_) {
         const char* name=reinterpret_cast<const char*>(sqlite3_column_text(stmt, 7));
-        compound->SetName(name);
+        if (name) {
+          compound->SetName(name);
+        }
       }
       // Load atoms and bonds      
       this->LoadAtomsFromDB(compound, pk);