I managed to solve it the problem was in the character class I was calling the enable widget function when the pawn I was casting to was set to nullptr.
I managed to solve it the problem was in the character class I was calling the enable widget function when the pawn I was casting to was set to nullptr.