2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

network: don't use assert to check if no network interfaces are returned

This commit is contained in:
Sönke Holz 2021-08-13 11:21:34 +02:00
parent 0476751ee2
commit b18e1d031f

View file

@ -363,8 +363,10 @@ NetworkInstance::~NetworkInstance() {
std::optional<IPv4Address> GetHostIPv4Address() {
const std::string& selected_network_interface = Settings::values.network_interface.GetValue();
const auto network_interfaces = Network::GetAvailableNetworkInterfaces();
ASSERT_MSG(network_interfaces.size() > 0,
"GetAvailableNetworkInterfaces returned no interfaces");
if (network_interfaces.size() == 0) {
LOG_ERROR(Network, "GetAvailableNetworkInterfaces returned no interfaces");
return {};
}
const auto res = std::ranges::find_if(network_interfaces,
[&selected_network_interface](const auto& interface) {