Fix crash on view page when badge is not found

Fixes a crash.