diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-04-24 06:09:59 +0000 |
|---|---|---|
| committer | John Smith <removethis.john.q.public@bigmail.com> | 2012-04-24 06:09:59 +0000 |
| commit | 5dc3fd1cc43883c0d41bebf1e5ee229dd1c24cc5 (patch) | |
| tree | 550d1abaf6632c9375ad4c4378a7478ea482486e /src/ui | |
| parent | Export: fix crash when removing last character in a selection (Bug #960980) (diff) | |
| download | inkscape-5dc3fd1cc43883c0d41bebf1e5ee229dd1c24cc5.tar.gz inkscape-5dc3fd1cc43883c0d41bebf1e5ee229dd1c24cc5.zip | |
Fix for 943275 : OCAL search crash when data not avaialable
(bzr r11289)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/ocaldialogs.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index 4c9245f5c..9dccb9c85 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -879,9 +879,11 @@ void SearchResultList::populate_from_xml(xmlNode * a_node) guint row_num = 0; for (xmlNode *cur_node = a_node; cur_node; cur_node = cur_node->next) { + // Get items information if (strcmp((const char*)cur_node->name, "rss")) // Avoid the root - if (cur_node->type == XML_ELEMENT_NODE && !strcmp((const char*)cur_node->parent->name, "item")) + if (cur_node->type == XML_ELEMENT_NODE && + (cur_node->parent->name && !strcmp((const char*)cur_node->parent->name, "item"))) { if (!strcmp((const char*)cur_node->name, "title")) { @@ -1055,7 +1057,7 @@ void ImportDialog::on_xml_file_read(const Glib::RefPtr<Gio::AsyncResult>& result list_results->populate_from_xml(root_element); // Populate the MARKUP column with the title & description of the clipart - for (guint i = 0; i <= list_results->size() - 1; i++) { + for (guint i = 0; i < list_results->size(); i++) { Glib::ustring title = list_results->get_text(i, RESULTS_COLUMN_TITLE); Glib::ustring description = list_results->get_text(i, RESULTS_COLUMN_DESCRIPTION); char* markup = g_markup_printf_escaped("<b>%s</b>\n<span size=\"small\">%s</span>", |
