Fix: [GithubCommitActivity] invalid branch error handling (#9258)

* Fix error handling of bad branch in [GithubCommitActivity]

When GraphQL response with a bad repo it returns an error indicating the bad repo.
When GraphQL has the currect repo with a bad branch it will null inside the repo object without an error object.
The privouse commits seems to try and use that but due not allowing null in schema it did not work and an error due to bad schema would show insted.

This commit fixes this issue

* Add test for invalid branch in [GithubCommitActivity]

---------

Co-authored-by: jNullj <jNullj@users.noreply.github.com>
This commit is contained in:
jNullj
2023-06-14 22:53:48 +03:00
committed by GitHub
parent 14892e3943
commit 35dfd75ef5
2 changed files with 8 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ const schema = Joi.object({
history: Joi.object({
totalCount: nonNegativeInteger,
}).required(),
}),
}).allow(null),
}).required(),
}).required(),
}).required()