xteakeymanager: don't explode if key loading fails

This commit is contained in:
Adam
2017-09-28 22:59:13 -04:00
parent 3414e27bd6
commit a58dca9cd0

View File

@@ -38,13 +38,22 @@ public class XteaKeyManager
private final Map<Integer, int[]> keys = new HashMap<>();
public void loadKeys() throws IOException
public void loadKeys()
{
XteaClient xteaClient = new XteaClient();
for (XteaKey key : xteaClient.get())
try
{
keys.put(key.getRegion(), key.getKeys());
for (XteaKey key : xteaClient.get())
{
keys.put(key.getRegion(), key.getKeys());
}
}
catch (IOException ex)
{
// happens on release when it is not deployed yet
logger.debug("unable to load xtea keys", ex);
return;
}
logger.info("Loaded {} keys", keys.size());