mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-04 03:10:50 +01:00
Fix creation of first key
This commit is contained in:
@@ -49,8 +49,13 @@ class ApiKeyCollection {
|
||||
private Collection<ApiKeyWithPassphrase> keys;
|
||||
|
||||
public ApiKeyCollection add(ApiKeyWithPassphrase key) {
|
||||
Collection<ApiKeyWithPassphrase> newKeys = new ArrayList<>(keys.size() + 1);
|
||||
newKeys.addAll(keys);
|
||||
Collection<ApiKeyWithPassphrase> newKeys;
|
||||
if (keys == null) {
|
||||
newKeys = new ArrayList<>();
|
||||
} else {
|
||||
newKeys = new ArrayList<>(keys.size() + 1);
|
||||
newKeys.addAll(keys);
|
||||
}
|
||||
newKeys.add(key);
|
||||
return new ApiKeyCollection(newKeys);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user