Skip to content

Commit 545e744

Browse files
committed
fix safety checks in getClassName()
1 parent d0abdec commit 545e744

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ function getTimeStringFromObject(timeObject, includeSeconds=true) {
469469
* @returns returns the class name for the given index or "No Class" if there is no class in session
470470
*/
471471
function getClassName(index) {
472-
if (classIsInSession() && index < data.schedules[currentScheduleIndex].classes.length) {
472+
if (!isNoSchoolDay() && index >= 0 && index < data.schedules[currentScheduleIndex].classes.length) {
473473
return data.schedules[currentScheduleIndex].classes[index].name.toString()
474474
} else {
475475
return "No Class"

0 commit comments

Comments
 (0)