From bb68fbf596e0906f0c12e1ff3bcf2751f9f75d27 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Tue, 18 Feb 2014 02:15:44 -0500 Subject: [PATCH] VRFS-1028 - Fixed an issue where a user has no instruments. This is probably an edge case, but Test User (id: 1) has no instruments, so this was not rendering and throwing a javascript error. --- web/app/assets/javascripts/hoverBand.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/app/assets/javascripts/hoverBand.js b/web/app/assets/javascripts/hoverBand.js index ecdfaa860..fc6ca414c 100644 --- a/web/app/assets/javascripts/hoverBand.js +++ b/web/app/assets/javascripts/hoverBand.js @@ -26,9 +26,11 @@ musicianHtml += '' + val.name + ''; instrumentHtml = '
'; - $.each(val.instruments, function(index, instrument) { - instrumentHtml += ' '; - }); + if (val.instruments) { // @FIXME: edge case for Test user that has no instruments? + $.each(val.instruments, function(index, instrument) { + instrumentHtml += ' '; + }); + } instrumentHtml += '
';