501stLegionA3 / FiveOhFirstDataCore

A Web App designed to manage the 501st Legion StarSim Roster.
https://dc.501stlegion-a3.com/
MIT License
8 stars 12 forks source link

Profile's "@Trooper.NickName's Squad" Links cause errors and disconnections on users without squads i.e razor / plt staff #252

Closed hobnob11 closed 2 years ago

hobnob11 commented 2 years ago

Describe the bug

Using the "@Trooper.NickName's Squad" links on a user's profile for users who do not have valid squads i.e platoon staff or razor causes an error and a database disconnection.

[2021-10-04T13:05:34.902Z] Error: There was an unhandled exception on the current circuit, 
so this circuit will be terminated. For more details turn on detailed exceptions by setting 
'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. 

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://dc.501stlegion-a3.com/trooper/34554
  2. Click on "Hobnob's Squad" / Platoon / Company
  3. See error

Doesn't apply to just razor, also applies to platoon staff positions i.e Cyclone 3 Romeo: https://dc.501stlegion-a3.com/trooper/29941

Expected behavior

Either the razor sections / flights / squadron should be displayed when selecting squad / platoon / company (cosmetic side note, a check here for the detachment to use the correct terms would be nice) Or the links should only be displayed when they're valid.

Screenshots

image

Platform

Google Chrome

Soyvolon commented 2 years ago

@jdoxley should be a simple fix to not display the squad/platoon/company pages if they do not have one so I'm assigning this to you. Also - displaying sections/flights for razor and mynock would be appreciated.