diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/tools.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/tools.cpp b/common/tools.cpp index c18d21e..d46e8c1 100644 --- a/common/tools.cpp +++ b/common/tools.cpp @@ -63,7 +63,11 @@ string GetAddressByInterface(string Interface){ return address; } string GetNetworkInterfaceByIndex(int Index, bool skipLoop){ - return GetNetworkInterfaces(skipLoop)[Index]; + StringVector interfaces = GetNetworkInterfaces(skipLoop); + if(interfaces.size() < 0) + return interfaces[Index]; + else + return string(); } StringVector GetNetworkInterfaces(bool skipLoop){ |