Skip to content

Commit

Permalink
Handle statistics result returning nil
Browse files Browse the repository at this point in the history
The backend statistics return no results (nil) in some corner cases.
We better use `blank?` than `empty?` to cover both empty array and nil.
  • Loading branch information
saraycp committed Dec 20, 2023
1 parent 9bc909e commit 2f20230
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/local_build_statistic/for_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(attributes = {})

def statistic
result = backend_statistics
return if result.empty?
return if result.blank?

disk = result.dig('disk', 'usage')
memory = result.dig('memory', 'usage')
Expand Down

0 comments on commit 2f20230

Please sign in to comment.