Commit 279af0f7 authored by Alexandre Savard's avatar Alexandre Savard

#9911: Fix network manager crashes

parent 97e78194
......@@ -32,13 +32,13 @@
#include "../manager.h"
#include "logger.h"
const std::string NetworkManager::statesString[5] = {"unknown", "asleep",
"connecting", "connected",
"disconnected"};
const std::string NetworkManager::statesString[] = {"unknown", "asleep",
"connecting", "connected",
"disconnected", "unknown",};
std::string NetworkManager::stateAsString(const uint32_t &state)
{
return statesString[state];
return statesString[state < 6 ? state : 5];
}
void NetworkManager::StateChanged(const uint32_t &state)
......
......@@ -56,7 +56,7 @@ class NetworkManager : public org::freedesktop::NetworkManager_proxy,
NM_STATE_DISCONNECTED
};
static const std::string statesString[5];
static const std::string statesString[];
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment