Make connectionProfileGroup support undefined values (#9102)

* Make connectionProfileGroup able to support undefined values being passed

* Fix strict null checks

* More strict null check fixes
This commit is contained in:
Charles Gagnon
2020-02-10 13:03:57 -08:00
committed by GitHub
parent c11c7d2f0e
commit eac05c85f1
3 changed files with 104 additions and 19 deletions

View File

@@ -117,14 +117,14 @@ export function generateUriWithPrefix(connection: IConnectionProfile, prefix: st
export function findProfileInGroup(og: IConnectionProfile, groups: ConnectionProfileGroup[]): ConnectionProfile | undefined {
for (let group of groups) {
for (let conn of group.connections) {
for (let conn of group.connections!) {
if (conn.id === og.id) {
return conn;
}
}
if (group.hasChildren()) {
let potentialReturn = findProfileInGroup(og, group.children);
let potentialReturn = findProfileInGroup(og, group.children!);
if (potentialReturn) {
return potentialReturn;
}