summaryrefslogtreecommitdiffstats
path: root/krandr
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-15 16:25:23 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-15 16:25:23 -0600
commitc1b662326338d960264edba69fcb4141073f97c7 (patch)
treee3fe6412c954c9109d4b8ce5c6a20ef904a36abd /krandr
parent4443b6dd886ce7d6fc6f99c594023fdd71d010b3 (diff)
downloadtdelibs-c1b662326338d960264edba69fcb4141073f97c7.tar.gz
tdelibs-c1b662326338d960264edba69fcb4141073f97c7.zip
Fix segfault when using a krandr-based program with no display profiles installed
Diffstat (limited to 'krandr')
-rw-r--r--krandr/libkrandr.cc14
1 files 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;