From c1b662326338d960264edba69fcb4141073f97c7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 15 Jan 2013 16:25:23 -0600 Subject: Fix segfault when using a krandr-based program with no display profiles installed --- krandr/libkrandr.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/krandr/libkrandr.cc b/krandr/libkrandr.cc index 04dd01be6..923b9f1a0 100644 --- a/krandr/libkrandr.cc +++ b/krandr/libkrandr.cc @@ -433,14 +433,16 @@ TQStringList KRandrSimpleAPI::getDisplayConfigurationProfiles(TQString kde_confd d.setSorting(TQDir::Name); const TQFileInfoList *list = d.entryInfoList(); - TQFileInfoListIterator it(*list); - TQFileInfo *fi; + if (list) { + TQFileInfoListIterator it(*list); + TQFileInfo *fi; - while ((fi = it.current()) != 0) { - if (fi->fileName() != "default") { - ret.append(fi->fileName()); + while ((fi = it.current()) != 0) { + if (fi->fileName() != "default") { + ret.append(fi->fileName()); + } + ++it; } - ++it; } return ret; -- cgit v1.2.1