mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Better to print an error message than to die with a npe.
This commit is contained in:
parent
9ebe83286e
commit
3343362328
@ -52,7 +52,12 @@ public class CloudStackConfigurationDaoImpl extends GenericDaoBase<CloudStackCon
|
|||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<CloudStackConfigurationVO> sc = NameSearch.create();
|
SearchCriteria<CloudStackConfigurationVO> sc = NameSearch.create();
|
||||||
sc.setParameters("name", name);
|
sc.setParameters("name", name);
|
||||||
return findOneBy(sc).getValue();
|
CloudStackConfigurationVO configItem = findOneBy(sc);
|
||||||
|
if (configItem == null) {
|
||||||
|
s_logger.warn("No configuration item found with name " + name);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return configItem.getValue();
|
||||||
}finally {
|
}finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user