From 71f9e33f2f48c6c4152c27dc71a63d8f491d5a44 Mon Sep 17 00:00:00 2001
From: Michael Oborne <mich146@hotmail.com>
Date: Fri, 20 Apr 2012 17:53:07 +0800
Subject: [PATCH] fix potential null pointer

---
 ArduPlane/GCS_Mavlink.pde | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde
index dcbd6a261..df31a1851 100644
--- a/ArduPlane/GCS_Mavlink.pde
+++ b/ArduPlane/GCS_Mavlink.pde
@@ -142,7 +142,7 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan, uint16_t pack
         control_sensors_present |= (1<<2); // compass present
     }
     control_sensors_present |= (1<<3); // absolute pressure sensor present
-    if (g_gps->fix) {
+    if (g_gps != NULL && g_gps->fix) {
         control_sensors_present |= (1<<5); // GPS present
     }
     control_sensors_present |= (1<<10); // 3D angular rate control
-- 
GitLab