From e8edeab641e97d213b95526183d1b61edd0dab69 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 14 Dec 2021 14:22:11 -0500 Subject: [PATCH] parseInt prevEventId and nextEventID to be sure that our tests for != 0 work. Also don't go to previous event if prevEventId ==0.Maybe Fixes #3390 --- web/skins/classic/views/js/event.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index b252c292c..04bf66b7e 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -446,8 +446,10 @@ function streamFastRev(action) { function streamPrev(action) { if (action) { $j(".vjsMessage").remove(); - location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery); - return; + if (prevEventId != 0) { + location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery); + return; + } /* Ideally I'd like to get back to this style if ( vid && PrevEventDefVideoPath.indexOf("view_video") > 0 ) { @@ -619,8 +621,8 @@ function getNearEventsResponse(respObj, respText) { if (checkStreamForErrors('getNearEventsResponse', respObj)) { return; } - prevEventId = respObj.nearevents.PrevEventId; - nextEventId = respObj.nearevents.NextEventId; + prevEventId = parseInt(respObj.nearevents.PrevEventId); + nextEventId = parseInt(respObj.nearevents.NextEventId); prevEventStartTime = Date.parse(respObj.nearevents.PrevEventStartTime); nextEventStartTime = Date.parse(respObj.nearevents.NextEventStartTime); PrevEventDefVideoPath = respObj.nearevents.PrevEventDefVideoPath;