From 95c0e132f48361e000555376e1ee6ae731af1cea Mon Sep 17 00:00:00 2001 From: acolla Date: Wed, 19 Dec 2007 14:32:15 +0000 Subject: [PATCH] Added protection in SetDefaultStorage and SetSpecificStorage against crashing in case of failure --- STEER/AliCDBManager.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STEER/AliCDBManager.cxx b/STEER/AliCDBManager.cxx index cd4c52d6e3d..db48c7bb1d4 100644 --- a/STEER/AliCDBManager.cxx +++ b/STEER/AliCDBManager.cxx @@ -297,6 +297,8 @@ void AliCDBManager::SetDefaultStorage(const char* dbString) { AliCDBStorage* bckStorage = fDefaultStorage; fDefaultStorage = GetStorage(dbString); + + if(!fDefaultStorage) return; if(bckStorage && (fDefaultStorage != bckStorage)){ AliWarning("Existing default storage replaced: clearing cache!"); @@ -317,6 +319,8 @@ void AliCDBManager::SetDefaultStorage(const AliCDBParam* param) { fDefaultStorage = GetStorage(param); + if(!fDefaultStorage) return; + if(bckStorage && (fDefaultStorage != bckStorage)){ AliWarning("Existing default storage replaced: clearing cache!"); ClearCache(); @@ -417,7 +421,8 @@ void AliCDBManager::SetSpecificStorage(const char* calibType, AliCDBParam* param if(checkPar) delete checkPar; delete fSpecificStorages.Remove(objCalibType); } - GetStorage(param); + AliCDBStorage *aStorage = GetStorage(param); + if(!aStorage) return; fSpecificStorages.Add(objCalibType, param->CloneParam()); -- 2.43.0