summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@gmpclient.org>2015-01-06 11:45:01 +0100
committerQball Cow <qball@gmpclient.org>2015-01-06 11:45:01 +0100
commit10cdd0e48e936d9c35ee3446e2540c4636c814aa (patch)
tree50ca692f0acf99d0e9e1723cc984f9ccff75d8b3
parentd0f9f6f0676a2c8cac1cdb5919e18fb5f86e73d7 (diff)
Do not crash on empty list in run dialog.
-rw-r--r--source/run-dialog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/run-dialog.c b/source/run-dialog.c
index e7f1e35c..f3cdb2b2 100644
--- a/source/run-dialog.c
+++ b/source/run-dialog.c
@@ -225,6 +225,10 @@ static char ** get_apps ( char **retv, unsigned int *length )
if ( config.run_list_command != NULL && config.run_list_command[0] != '\0' ) {
retv = get_apps_external ( retv, length );
}
+ // No sorting needed.
+ if((*length) == 0) {
+ return retv;
+ }
// TODO: check this is still fast enough. (takes 1ms on laptop.)
if ( ( *length ) > num_favorites ) {
qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func );