TUM-Dev / gocast

TUMs lecture streaming service.
https://live.rbg.tum.de/
MIT License
177 stars 41 forks source link

null check in sql preventing null to int conversion error (#1215) #1358

Closed karjo24 closed 3 weeks ago

karjo24 commented 4 weeks ago

Motivation and Context

fixes #1215. Currently, the server throws a "cannot convert null to int"-error on the stats page, when no student has watched any vod or stream of this course yet. This is because there is no entry in the database referring to this specific course.

Description

Null check in SQL, returns 0 instead of null.

Steps for Testing

Prerequisites: default testing database

Steps:

  1. Before applying changes, go to http://localhost:8081/admin/course/1/stats. See that the "Vod Views" and "Live Views" show a loading indicator and a server error is thrown as described in issue.
  2. Apply change
  3. Reload, note that 0 is shown instead of loading indicator and no error is thrown.
github-actions[bot] commented 4 weeks ago

Your Testserver will be ready at https://1358.test.live.mm.rbg.tum.de in a few minutes.

Logins | Kurs1 | Kurs2 | Kurs3 | Kurs4 | | ---------------------------------------- | ------------------------- | ------------------------- | ------------------------- | | public | public | loggedin | enrolled | | prof1 | prof1 | prof2 | prof1
prof2 | | student1
student2
student3 | student1
student2 | student2
student3 | student1
student2 |