diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-01-30 10:22:46 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-01-30 10:22:46 +0000 |
| commit | 0605b3e5559d3124a89c1270ae9b453388c838c7 (patch) | |
| tree | 005f22714aea8e28f9558d8a5e684cd0a92d6c7c /src | |
| parent | Revert sp-image until the refactoring takes. (diff) | |
| download | inkscape-0605b3e5559d3124a89c1270ae9b453388c838c7.tar.gz inkscape-0605b3e5559d3124a89c1270ae9b453388c838c7.zip | |
Prevent crash if a symbols file does not have a title.
(bzr r12985)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index c33920117..7079ca001 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -562,10 +562,18 @@ void SymbolsDialog::get_symbols() { symbol_doc = SPDocument::createNewDoc( fullname, FALSE ); if( symbol_doc ) { - const gchar *title = g_dpgettext2(NULL, "Symbol", symbol_doc->getRoot()->title()); + + const gchar *title = symbol_doc->getRoot()->title(); + + // A user provided file may not have a title + if( title != NULL ) { + title = g_dpgettext2(NULL, "Symbol", title); // Translate + } + if( title == NULL ) { title = _("Unnamed Symbols"); } + symbolSets[Glib::ustring(title)] = symbol_doc; symbolSet->append(title); } |
