summaryrefslogtreecommitdiff
path: root/lib/bitbucket/representation/pull_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bitbucket/representation/pull_request.rb')
-rw-r--r--lib/bitbucket/representation/pull_request.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bitbucket/representation/pull_request.rb b/lib/bitbucket/representation/pull_request.rb
index e37c9a62c0e..eebf8093380 100644
--- a/lib/bitbucket/representation/pull_request.rb
+++ b/lib/bitbucket/representation/pull_request.rb
@@ -2,7 +2,7 @@ module Bitbucket
module Representation
class PullRequest < Representation::Base
def author
- raw.dig('author', 'username')
+ raw.fetch('author', {}).fetch('username', nil)
end
def description
@@ -36,19 +36,19 @@ module Bitbucket
end
def source_branch_name
- source_branch.dig('branch', 'name')
+ source_branch.fetch('branch', {}).fetch('name', nil)
end
def source_branch_sha
- source_branch.dig('commit', 'hash')
+ source_branch.fetch('commit', {}).fetch('hash', nil)
end
def target_branch_name
- target_branch.dig('branch', 'name')
+ target_branch.fetch('branch', {}).fetch('name', nil)
end
def target_branch_sha
- target_branch.dig('commit', 'hash')
+ target_branch.fetch('commit', {}).fetch('hash', nil)
end
private