From 108d4f1c72356a17a8fb8cc0a8a771a25afdb31f Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Fri, 7 Mar 2014 23:23:55 +0000
Subject: [PATCH] [Fix] Killed chances of possible seg fault.

---
 src/pilot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pilot.c b/src/pilot.c
index 0263b21..565818b 100644
--- a/src/pilot.c
+++ b/src/pilot.c
@@ -457,7 +457,7 @@ void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter,
       pilot_dead(p);
       /* Adjust the combat rating based on pilot mass and ditto faction. */
       pshooter = pilot_get(shooter);
-      if(pshooter->faction == FACTION_PLAYER) {
+      if((pshooter != NULL) && (pshooter->faction == FACTION_PLAYER)) {
         mod = sqrt(p->ship->mass) / 5;
         player_crating += 2*mod; /* Crating chanes faster. */
         faction_modPlayer(p->faction, -mod);