mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: don't crash in battery_remove
If device has no adapter, then there's no battery provider.
This commit is contained in:
		
							parent
							
								
									dda65b95af
								
							
						
					
					
						commit
						a4b1e4c42a
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -229,7 +229,7 @@ static void battery_remove(struct spa_bt_device *device) {
 | 
				
			||||||
		device->battery_pending_call = NULL;
 | 
							device->battery_pending_call = NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!device->adapter->has_battery_provider || !device->has_battery)
 | 
						if (!device->adapter || !device->adapter->has_battery_provider || !device->has_battery)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(device->monitor->log, "Removing virtual battery: %s", device->battery_path);
 | 
						spa_log_debug(device->monitor->log, "Removing virtual battery: %s", device->battery_path);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue