diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js
index 15dd160e..8e7a2a71 100644
--- a/code/portal_detail_display.js
+++ b/code/portal_detail_display.js
@@ -22,9 +22,8 @@ window.renderPortalDetails = function(guid) {
var linksText = [linkExpl('links'), linkExpl(' ↳ ' + links.incoming+' • '+links.outgoing+' ↴')];
var player = d.captured && d.captured.capturingPlayerId
- ? getPlayerName(d.captured.capturingPlayerId)
+ ? '' + getPlayerName(d.captured.capturingPlayerId) + ''
: null;
- player = ''+player+'';
var playerText = player ? ['owner', player] : null;
var time = d.captured
diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js
index 9a50e1b7..1687f5d9 100644
--- a/code/portal_detail_display_tools.js
+++ b/code/portal_detail_display_tools.js
@@ -132,7 +132,7 @@ window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
var meter = '' + fill + lbar + '';
}
- nick = ''+nick+'';
+ nick = nick ? ''+nick+'' : null;
return [meter, nick || ''];
}
diff --git a/code/portal_info.js b/code/portal_info.js
index 2e2e2127..fdbc91c2 100644
--- a/code/portal_info.js
+++ b/code/portal_info.js
@@ -64,7 +64,7 @@ window.getAvgResoDist = function(d) {
sum += parseInt(reso.distanceToPortal);
resos++;
});
- return sum/resos;
+ return resos ? sum/resos : 0;
}
window.getAttackApGain = function(d) {