diff --git a/endpoints/trigger.py b/endpoints/trigger.py index 2bcdc6242..311c6aaf5 100644 --- a/endpoints/trigger.py +++ b/endpoints/trigger.py @@ -244,7 +244,11 @@ class BitbucketBuildTrigger(BuildTriggerHandler): def _get_authorized_client(self): base_client = self._get_client() auth_token = self.auth_token or 'invalid:invalid' - (access_token, access_token_secret) = auth_token.split(':') + token_parts = auth_token.split(':') + if len(token_parts) != 2: + token_parts = ['invalid', 'invalid'] + + (access_token, access_token_secret) = token_parts return base_client.get_authorized_client(access_token, access_token_secret) def _get_repository_client(self):