[glom] FlowTableWithFields::add_field(): Avoid null pointer dereference.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] FlowTableWithFields::add_field(): Avoid null pointer dereference.
- Date: Fri, 5 Dec 2014 10:02:10 +0000 (UTC)
commit d91678914ba823034c5637813ae3ac53b7bc87d0
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 4 21:00:23 2014 +0100
FlowTableWithFields::add_field(): Avoid null pointer dereference.
Found by scan-build.
glom/mode_data/flowtablewithfields.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index bf65381..0406a6e 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -496,7 +496,9 @@ void FlowTableWithFields::add_field(const sharedptr<LayoutItem_Field>& layoutite
}
Gtk::EventBox* eventbox = Gtk::manage(new Gtk::EventBox());
- eventbox->add(*info.m_first);
+ if(info.m_first)
+ eventbox->add(*info.m_first);
+
eventbox->set_halign(Gtk::ALIGN_START);
info.m_first_eventbox = eventbox; //Remember it so we can retrieve the column number later from FlowTable.
eventbox->set_visible_window(false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]