]> source.dussan.org Git - gitea.git/commit
Protect against NPEs in notifications list (#10879) (#10883)
authorzeripath <art27@cantab.net>
Mon, 30 Mar 2020 07:23:02 +0000 (08:23 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Mar 2020 07:23:02 +0000 (15:23 +0800)
commit596eebb2b6d25332c7c1de6a9d23373e2260eeb5
tree2a4ceec6d8a6ea7c193cc792c8409748f1bd07b4
parent1d5d7458516a3f04d822cb35875a3050c12760af
Protect against NPEs in notifications list (#10879) (#10883)

* Protect against NPEs in notifications list (#10879)

Unfortunately there appears to be potential race with notifications
being set before the associated issue has been committed.

This PR adds protection in to the notifications list to log any failures
and remove these notifications from the display.

References #10815 - and prevents the panic but does not completely fix
this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add log import

* Update models/notification.go

Co-Authored-By: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
models/notification.go
routers/user/notification.go