Kaydet (Commit) a91d7e2d authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#704766 Dereference after null check

Change-Id: I8491260f198e80138241de891ef29cc8ab21a008
üst d37f5fdd
...@@ -38,24 +38,21 @@ SdTransferable* TransferableData::CreateTransferable ( ...@@ -38,24 +38,21 @@ SdTransferable* TransferableData::CreateTransferable (
return pTransferable; return pTransferable;
} }
::boost::shared_ptr<TransferableData> TransferableData::GetFromTransferable (const SdTransferable* pTransferable) ::boost::shared_ptr<TransferableData> TransferableData::GetFromTransferable (const SdTransferable* pTransferable)
{ {
::boost::shared_ptr<TransferableData> pData; if (pTransferable)
for (sal_Int32 nIndex=0,nCount=pTransferable->GetUserDataCount(); nIndex<nCount; ++nIndex)
{ {
pData = ::boost::dynamic_pointer_cast<TransferableData>(pTransferable->GetUserData(nIndex)); for (sal_Int32 nIndex=0,nCount=pTransferable->GetUserDataCount(); nIndex<nCount; ++nIndex)
if (pData) {
return pData; ::boost::shared_ptr<TransferableData> xData =
::boost::dynamic_pointer_cast<TransferableData>(pTransferable->GetUserData(nIndex));
if (xData)
return xData;
}
} }
return ::boost::shared_ptr<TransferableData>(); return ::boost::shared_ptr<TransferableData>();
} }
TransferableData::TransferableData ( TransferableData::TransferableData (
SlideSorterViewShell* pViewShell, SlideSorterViewShell* pViewShell,
const ::std::vector<Representative>& rRepresentatives) const ::std::vector<Representative>& rRepresentatives)
......
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