]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added protection in SetDefaultStorage and SetSpecificStorage against crashing in...
authoracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2007 14:32:15 +0000 (14:32 +0000)
committeracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2007 14:32:15 +0000 (14:32 +0000)
STEER/AliCDBManager.cxx

index cd4c52d6e3d5d59c6fcd982ce1aff6789f2e4a5f..db48c7bb1d4a78096d8351acf8e7ff1271c21f19 100644 (file)
@@ -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());