diff options
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index a73e89d640..fe6e12b592 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -458,6 +458,12 @@ LBL_WriteString: mir_cslockfull lck(m_csDbAccess);
+ DWORD ofsBlobPtr, ofsContact = GetContactOffset(contactID);
+ if (ofsContact == 0) {
+ _ASSERT(false); // contact doesn't exist?
+ return 2;
+ }
+
char *szCachedSettingName = m_cache->GetCachedSetting(dbcwWork.szModule, dbcwWork.szSetting, moduleNameLen, settingNameLen);
log3("set [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
@@ -491,7 +497,6 @@ LBL_WriteString: log1(" write database as %s", printVariant(&dbcwWork.value));
DWORD ofsModuleName = GetModuleNameOfs(dbcwWork.szModule);
- DWORD ofsBlobPtr, ofsContact = GetContactOffset(contactID);
DBContact dbc = *(DBContact*)DBRead(ofsContact, sizeof(DBContact), NULL);
if (dbc.signature != DBCONTACT_SIGNATURE)
return 1;
|