Skip to content

Commit

Permalink
Merge pull request #1043 from Heroes-Profile/NullValueMMRFix-PlayerHe…
Browse files Browse the repository at this point in the history
…roAll

Fixes null value for stat, specifically for MMR for modes not selected
  • Loading branch information
Zemill authored Jul 7, 2024
2 parents 4b4f1d3 + cae21e4 commit a6ec5a8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@
<span class="link" @click="navigateToMaxStatMatch(row.hero, stat.value, row[stat.value])" title="Navigate to this match">{{ showStatValue(stat.value, row[stat.value]) }}</span>
</div>
<div v-else>
{{ showStatValue(stat.value, row[stat.value]) }}
{{ stat.value !== null ? showStatValue(stat.value, row[stat.value]) : '' }}
</div>

</td>
</template>

Expand Down Expand Up @@ -397,10 +398,10 @@ export default {
},
showStatValue(stat, value) {
var returnValue = null;
if (!value || isNaN(value)) {
returnValue = 0;
if (value == null || value === undefined || isNaN(value)) {
return 0;
}
if (value < 1000) {
returnValue = value.toFixed(2);
} else {
Expand Down

0 comments on commit a6ec5a8

Please sign in to comment.