summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-02 10:24:57 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-08-02 13:41:06 +0000
commitc5fb2644c92c8012b66cf2d1a12d6ce666beed25 (patch)
tree643bb0ff07f7b5fc8a5cdac182114a114d64dc62 /dbaccess
parent04d1e80ac7091ec2bf31c8617e832d5fe15350be (diff)
Check that xKeys exists before using.
Currently base segfaults here when using a database driver that doesn't support sdbcx, the internal sdbcx wrapper doesn't implement getKeys() either. Change-Id: I195dfa891b4e38e6e0f5a9286bcbfa66ca818e28 Reviewed-on: https://gerrit.libreoffice.org/5243 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index f17ff9b7aca3..f75b3e8b8ffe 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -774,6 +774,8 @@ void OTableController::appendPrimaryKey(Reference<XKeysSupplier>& _rxSup,sal_Boo
OSL_ENSURE(_rxSup.is(),"No XKeysSupplier!");
Reference<XIndexAccess> xKeys(_rxSup->getKeys(),UNO_QUERY);
Reference<XPropertySet> xProp;
+ if (!xKeys.is())
+ return;
const sal_Int32 nCount = xKeys->getCount();
for(sal_Int32 i=0;i< nCount ;++i)
{