From 9643fe1187d3e2d50406016ed71e9082e3e5a0ce Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 9 Jan 2015 02:38:38 -0500 Subject: [PATCH] fixed javascript error on session detail screen --- .../javascripts/accounts_session_detail.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/accounts_session_detail.js b/web/app/assets/javascripts/accounts_session_detail.js index d75a5ea2e..82c028e52 100644 --- a/web/app/assets/javascripts/accounts_session_detail.js +++ b/web/app/assets/javascripts/accounts_session_detail.js @@ -339,7 +339,14 @@ if ("instrument_list" in pending_rsvp_request && pending_rsvp_request.instrument_list != null) { $.each(pending_rsvp_request.instrument_list, function (index, instrument) { - var instrumentId = context.JK.getInstrumentId(instrument.id); + var instrumentId; + + if (instrument) { + instrumentId = context.JK.getInstrumentId(instrument.id); + } + else { + instrumentId = 'other'; + } var inst = context.JK.getInstrumentIcon24(instrumentId); instrumentLogoHtml += ' '; instrumentDesc.push(instrumentId); @@ -378,7 +385,14 @@ $.each(sessionData.approved_rsvps, function(index, approved_rsvp) { if ("instrument_list" in approved_rsvp) { $.each(approved_rsvp.instrument_list, function(index, instrument) { - var instrumentId = context.JK.getInstrumentId(instrument.id); + var instrumentId; + + if (instrument) { + instrumentId = context.JK.getInstrumentId(instrument.id); + } + else { + instrumentId = 'other'; + } var inst = context.JK.getInstrumentIcon24(instrumentId); instrumentLogoHtml += ' '; });