File patch-r895086.diff of Package kdelibs4

Subject: Fix crash on editing an icon whose .desktop doesn't exists
From: wstephenson@suse.de
Bug: kde#167439
Patch-upstream: 895086
--- kio/kfile/kpropertiesdialog.cpp	(revision 895085)
+++ kio/kfile/kpropertiesdialog.cpp	(revision 895086)
@@ -1296,7 +1296,7 @@ void KFilePropsPlugin::applyChanges()
   {
     QString n = ((QLineEdit *) d->nameArea)->text();
     // Remove trailing spaces (#4345)
-    while ( n[n.length()-1].isSpace() )
+    while ( ! n.isEmpty() && n[n.length()-1].isSpace() )
       n.truncate( n.length() - 1 );
     if ( n.isEmpty() )
     {
Index: kio/kfile/kpropertiesdialog.cpp
===================================================================
openSUSE Build Service is sponsored by