summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/styledialog.cpp
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-06-19 10:59:01 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-06-19 10:59:01 +0000
commit71959483ca7952c2b90c9b04651c187b6e17a19b (patch)
tree5b3481d7a44bda9c164f44374d5f0eb2e140d292 /src/ui/dialog/styledialog.cpp
parentFix a crash while deleting when there was single selector in the style dialog (diff)
downloadinkscape-71959483ca7952c2b90c9b04651c187b6e17a19b.tar.gz
inkscape-71959483ca7952c2b90c9b04651c187b6e17a19b.zip
Resolve crash when empty string was added via entrybox in style dialog
(bzr r14949.1.24)
Diffstat (limited to 'src/ui/dialog/styledialog.cpp')
-rw-r--r--src/ui/dialog/styledialog.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp
index f81faec97..a7a803edd 100644
--- a/src/ui/dialog/styledialog.cpp
+++ b/src/ui/dialog/styledialog.cpp
@@ -155,11 +155,16 @@ void StyleDialog::_addSelector()
* with a dot.
*/
std::string selectorName = "";
- if ( textEditPtr->get_text().at(0) == '#' ||
- textEditPtr->get_text().at(0) == '.' )
- selectorName = textEditPtr->get_text();
- else
- selectorName = "." + textEditPtr->get_text();
+ if ( !textEditPtr->get_text().empty() ) {
+ if ( textEditPtr->get_text().at(0) == '#' ||
+ textEditPtr->get_text().at(0) == '.' )
+ selectorName = textEditPtr->get_text();
+ else
+ selectorName = "." + textEditPtr->get_text();
+ }
+ else {
+ selectorName = ".Class1";
+ }
switch (result) {
case Gtk::RESPONSE_OK: