BUG FIX when there is no usedSettings
[satune.git] / src / Tuner / searchtuner.cc
index 9ab6d45..3cf94fb 100644 (file)
@@ -175,7 +175,8 @@ bool SearchTuner::isSubTunerof(SearchTuner *newTuner) {
 
 SearchTuner *SearchTuner::copyUsed() {
        SearchTuner *tuner = new SearchTuner();
 
 SearchTuner *SearchTuner::copyUsed() {
        SearchTuner *tuner = new SearchTuner();
-       SetIteratorTunableSetting *iterator = usedSettings.iterator();
+       
+       SetIteratorTunableSetting *iterator = !usedSettings.isEmpty()? usedSettings.iterator():settings.iterator();
        while (iterator->hasNext()) {
                TunableSetting *setting = iterator->next();
                TunableSetting *copy = new TunableSetting(setting);
        while (iterator->hasNext()) {
                TunableSetting *setting = iterator->next();
                TunableSetting *copy = new TunableSetting(setting);