Skip to content

Commit

Permalink
Dev: avoid division by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Feb 20, 2017
1 parent 27ce73d commit 0e5f5fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/default/views/subviews/top_container.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if aSurveyInfo.format != 'A' and aSurveyInfo.showprogress is defined and aSurveyInfo.showprogress == 'Y' %}
{{ registerPublicCssFile('lime-progress.css') }}

{% set progressValue = intval( (aSurveyInfo.progress.currentstep - 1) / aSurveyInfo.progress.total * 100 )%}
{% set progressValue = ( aSurveyInfo.progress.total > 0 ) ? intval( (aSurveyInfo.progress.currentstep - 1) / aSurveyInfo.progress.total * 100 ) : 0 %}
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{{ progressValue }}" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width: {{ progressValue }}%;">
{{ progressValue }}%
Expand Down

0 comments on commit 0e5f5fe

Please sign in to comment.