From 0ae254f6a8d9b03e4497ca3c731a6ecabd65cc73 Mon Sep 17 00:00:00 2001 From: graffy76 Date: Thu, 18 Jul 2013 06:31:47 -0500 Subject: [PATCH] Fixed segfault opening tables --- apps/opencs/view/world/table.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index f188adfaf..315f4c742 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -217,9 +217,12 @@ void CSVWorld::Table::updateEditorSetting (const QString &settingName, const QSt if (settingName == "Referenceable ID Type Display") { - RefIdTypeDelegate &refidDelegate = dynamic_cast (*itemDelegateForColumn(2)); + RefIdTypeDelegate *refidDelegate = dynamic_cast (itemDelegateForColumn(2)); - refidDelegate.updateEditorSetting (settingName, settingValue); - emit dataChanged(mModel->index(0,1), mModel->index(mModel->rowCount()-1, 1)); + if (refidDelegate) + { + refidDelegate->updateEditorSetting (settingName, settingValue); + emit dataChanged(mModel->index(0,1), mModel->index(mModel->rowCount()-1, 1)); + } } }