diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/network/network_interface.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/network/network_interface.cpp b/src/core/network/network_interface.cpp index cecc9aa11..a8f41c6bc 100644 --- a/src/core/network/network_interface.cpp +++ b/src/core/network/network_interface.cpp | |||
| @@ -180,11 +180,11 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { | |||
| 180 | #endif | 180 | #endif |
| 181 | 181 | ||
| 182 | std::optional<NetworkInterface> GetSelectedNetworkInterface() { | 182 | std::optional<NetworkInterface> GetSelectedNetworkInterface() { |
| 183 | const std::string& selected_network_interface = Settings::values.network_interface.GetValue(); | 183 | const auto& selected_network_interface = Settings::values.network_interface.GetValue(); |
| 184 | const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); | 184 | const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); |
| 185 | if (network_interfaces.size() == 0) { | 185 | if (network_interfaces.size() == 0) { |
| 186 | LOG_ERROR(Network, "GetAvailableNetworkInterfaces returned no interfaces"); | 186 | LOG_ERROR(Network, "GetAvailableNetworkInterfaces returned no interfaces"); |
| 187 | return {}; | 187 | return std::nullopt; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | const auto res = | 190 | const auto res = |
| @@ -192,12 +192,12 @@ std::optional<NetworkInterface> GetSelectedNetworkInterface() { | |||
| 192 | return iface.name == selected_network_interface; | 192 | return iface.name == selected_network_interface; |
| 193 | }); | 193 | }); |
| 194 | 194 | ||
| 195 | if (res != network_interfaces.end()) { | 195 | if (res == network_interfaces.end()) { |
| 196 | return *res; | ||
| 197 | } else { | ||
| 198 | LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", selected_network_interface); | 196 | LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", selected_network_interface); |
| 199 | return {}; | 197 | return std::nullopt; |
| 200 | } | 198 | } |
| 199 | |||
| 200 | return *res; | ||
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | } // namespace Network | 203 | } // namespace Network |