How to check if a player has a object attached to a socket?

Hey guys, so I am having an issue with my game project. SO right now i have a weapon placed in the world that the player can walk over and when the player overlaps with the weapon it will attach to the socket that I want it to. My issue is now I want to create a shooting mechanic bc the weapon in the world is a gun. I coded in a Particle System and chose the particle muzzle flash that I want to happen in BluePrints when the player presses the LMB. However, once I start the game and press the LMB when I have the weapon equipped or not the engine just crashes. But, if I put in a UE_LOG without the particle system code everything works just fine. So I’m wondering if I need some sore of check in place to prevent the crash and spawn the particle system properly when the player presses the LMB when the weapon is equipped.

Below is the message that I get. I see that it says unhandled exception which tipped me off that I need a check in place. just need to figure out how to do it.

LoginId:b8a5f68c4cb1fbc518ccb4900c6e42a2
EpicAccountId:675aaccd4d2344d7a448edb38550ac65

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000300

UE4Editor_ZombieArena!AWeapon::PullTrigger() [C:\Users\\OneDrive\Desktop\UnrealProjects\ZombieArena\Source\ZombieArena\Weapon.cpp:56]
UE4Editor_Engine!FInputActionUnifiedDelegate::Execute() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h:288]
UE4Editor_Engine!UPlayerInput::ProcessInputStack() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1379]
UE4Editor_Engine!APlayerController::ProcessPlayerInput() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2531]
UE4Editor_Engine!APlayerController::TickPlayerInput() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4550]
UE4Editor_Engine!APlayerController::PlayerTick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2179]
UE4Editor_Engine!APlayerController::TickActor() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4702]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:173]
UE4Editor_Engine!FTickFunctionTask::DoTask() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284]
UE4Editor_Engine!TGraphTask::ExecuteTask() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:886]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:709]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:601]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:1525]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:564]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1578]
UE4Editor_Engine!UWorld::RunTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:782]
UE4Editor_Engine!UWorld::Tick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1457]
UE4Editor_UnrealEd!UEditorEngine::Tick() [D:\Build\++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1720]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [D:\Build\++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:426]
UE4Editor!FEngineLoop::Tick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4836]
UE4Editor!GuardedMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:169]
UE4Editor!GuardedMainWrapper() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
UE4Editor!WinMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]
UE4Editor!__scrt_common_main_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll 

Any help or direction would be greatly appreciated.

The error is saying that in your Weapon.cpp line 56 you’re trying to access a member of an object that is null. This can happen when you have declared an object without initializing it and you then try to call a function or read a property from it. Make sure that whatever object you’re accessing in that line has been initialized properly beforehand.