mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	[#178 state:fixed] Fixed a crash on adding a criterion with an empty selection.
This commit is contained in:
		
							parent
							
								
									a6deb04049
								
							
						
					
					
						commit
						fbe66d27c9
					
				| @ -61,6 +61,8 @@ class PrioritizeDialog: | ||||
| 
 | ||||
|     def add_selected(self): | ||||
|         # Add selected criteria in criteria_list to prioritization_list. | ||||
|         if self.criteria_list.selected_index is None: | ||||
|             return | ||||
|         crit = self.criteria[self.criteria_list.selected_index] | ||||
|         self.prioritizations.append(crit) | ||||
|         self.prioritization_list[:] = [crit.display for crit in self.prioritizations] | ||||
|  | ||||
| @ -123,6 +123,11 @@ def test_remove_crit_from_list(app): | ||||
|     ] | ||||
|     eq_(app.pdialog.prioritization_list[:], expected) | ||||
| 
 | ||||
| @with_app(app_normal_results) | ||||
| def test_add_crit_without_selection(app): | ||||
|     # Adding a criterion without having made a selection doesn't cause a crash. | ||||
|     app.pdialog.add_selected() # no crash | ||||
| 
 | ||||
| #--- | ||||
| def app_one_name_ends_with_number(): | ||||
|     dupes = [ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user