Why am I getting an access violation?

I have a public method SetSize in my ABasePawn class. I extended ABasePawn class with AAIPawn class. In my code I call the SetSize method on an instance of AAIPawn. When I run my game, i have a menu to choose the difficulty in a widget blueprint that calls my C++ code that calls SetSize. However, my editor crashses and says this:

Access violation - code c0000005 (first/second change not available).

Why am I getting an access violation issue?

Hello ,

Could you post the rest of the callstack that you receive and possibly the code related to this function that is causing your crash? We would need more context to have an idea as to what is causing your problem.

Oh I realized that there was code I thought I saved for instantiating some variables but turns out those statements were missing. I am no longer getting this issue.