Commit 468d2b2edd5a70ca8311cd21b54768b3911fd180
1 parent
c79b3692
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
prevent null pointer exception in smile block
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
plugins/serpro_integration/lib/serpro_integration_plugin/smile_block.rb
... | ... | @@ -35,6 +35,11 @@ class SerproIntegrationPlugin::SmileBlock < Block |
35 | 35 | collect_sonar_information |
36 | 36 | factor = (self.sonar_info[METRIC_COVERAGE] * self.sonar_info[METRIC_SUCCESS_DENSITY]).to_f/1000 |
37 | 37 | factor |
38 | + collect_sonar_information | |
39 | + factor = 0 | |
40 | + if self.sonar_info[METRIC_COVERAGE] && self.sonar_info[METRIC_SUCCESS_DENSITY] | |
41 | + factor = (self.sonar_info[METRIC_COVERAGE] * self.sonar_info[METRIC_SUCCESS_DENSITY]).to_f/1000 | |
42 | + end | |
38 | 43 | end |
39 | 44 | |
40 | 45 | #FIXME make this test | ... | ... |