From 281d3b1189287c7d943446433d668324a7ad036c Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Mon, 11 Mar 2019 14:06:56 -0700 Subject: [PATCH] AC_Fence: check the return value of fetching the EKF origin --- libraries/AC_Fence/AC_Fence.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/AC_Fence/AC_Fence.cpp b/libraries/AC_Fence/AC_Fence.cpp index 1a24dd2714..161ee213a7 100644 --- a/libraries/AC_Fence/AC_Fence.cpp +++ b/libraries/AC_Fence/AC_Fence.cpp @@ -550,7 +550,9 @@ bool AC_Fence::load_polygon_from_eeprom(bool force_reload) return false; } struct Location ekf_origin {}; - AP::ahrs().get_origin(ekf_origin); + if (!AP::ahrs().get_origin(ekf_origin)) { + return false; + } // sanity check total _total = constrain_int16(_total, 0, _poly_loader.max_points());