Kaydet (Commit) 34d6e779 authored tarafından David Tardon's avatar David Tardon

avoid potential null dereference

Change-Id: I2236a18608ffa9481c30088044f34e1a3372dd11
üst 8c536baf
......@@ -255,9 +255,13 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
sal_Int32 nStandardKey(0);
if(xFormatTypes.is())
{
css::lang::Locale loc;
if (xFormats->getByKey(nKeyToUse)->getPropertyValue("Locale") >>= loc)
nStandardKey = xFormatTypes->getStandardIndex(loc);
const Reference< XPropertySet > xFormatProps(xFormats->getByKey(nKeyToUse));
if (xFormatProps.is())
{
css::lang::Locale loc;
if (xFormatProps->getPropertyValue("Locale") >>= loc)
nStandardKey = xFormatTypes->getStandardIndex(loc);
}
}
// Why use nStandardKey rather than nKeyToUse here? Don't know, but "it was always like that".
// Previously had hardcoded 0 instead of nStandardKey, which led to problems with dates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment