Check oid before calling localCommitsRelative to avoid crashes
This commit is contained in:
parent
20f2e22076
commit
89f2d6e764
1 changed files with 5 additions and 0 deletions
|
|
@ -755,6 +755,11 @@ class PasswordStore {
|
||||||
}
|
}
|
||||||
let remoteMasterBranch = try storeRepository.remoteBranches()[index]
|
let remoteMasterBranch = try storeRepository.remoteBranches()[index]
|
||||||
|
|
||||||
|
// check oid before calling localCommitsRelative
|
||||||
|
guard remoteMasterBranch.oid != nil else {
|
||||||
|
throw AppError.RepositoryRemoteMasterNotFoundError
|
||||||
|
}
|
||||||
|
|
||||||
// get a list of local commits
|
// get a list of local commits
|
||||||
return try storeRepository.localCommitsRelative(toRemoteBranch: remoteMasterBranch)
|
return try storeRepository.localCommitsRelative(toRemoteBranch: remoteMasterBranch)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue