mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Bugfix: prevent crash when setting a Choice field to a non-indexed value
This commit is contained in:
		
							parent
							
								
									48f1fab49f
								
							
						
					
					
						commit
						5844b956be
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -239,8 +239,13 @@ sub set_value { | |||
|      | ||||
|     $self->disable_change_event(1); | ||||
|      | ||||
|     my $idx; | ||||
|     if ($self->option->values) { | ||||
|         my $idx = first { $self->option->values->[$_] eq $value } 0..$#{$self->option->values}; | ||||
|         $idx = first { $self->option->values->[$_] eq $value } 0..$#{$self->option->values}; | ||||
|         # if value is not among indexes values we use SetValue() | ||||
|     } | ||||
|      | ||||
|     if (defined $idx) { | ||||
|         $self->wxWindow->SetSelection($idx); | ||||
|     } else { | ||||
|         $self->wxWindow->SetValue($value); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci