diff --git a/common/unit.c b/common/unit.c
index dc8776fcdd..6a0603a227 100644
--- a/common/unit.c
+++ b/common/unit.c
@@ -2755,6 +2755,10 @@ bool unit_order_list_is_sane(const struct civ_map *nmap,
 {
   int i;
 
+  if (orders == NULL) { // no orders
+    return TRUE;
+  }
+
   for (i = 0; i < length; i++) {
     struct action *paction;
     struct extra_type *pextra;
diff --git a/server/savegame/savegame2.c b/server/savegame/savegame2.c
index 3937d3a05e..980f51a760 100644
--- a/server/savegame/savegame2.c
+++ b/server/savegame/savegame2.c
@@ -4738,6 +4738,7 @@ static bool sg_load_player_unit(struct loaddata *loading,
           /* An invalid order. Just drop the orders for this unit. */
           free(punit->orders.list);
           punit->orders.list = NULL;
+          punit->orders.length = 0;
           punit->has_orders = FALSE;
           break;
         }
@@ -4810,6 +4811,7 @@ static bool sg_load_player_unit(struct loaddata *loading,
     } else {
       punit->has_orders = FALSE;
       punit->orders.list = NULL;
+      punit->orders.length = 0;
 
       (void) secfile_entry_lookup(loading->file, "%s.orders_index", unitstr);
       (void) secfile_entry_lookup(loading->file, "%s.orders_repeat", unitstr);
@@ -5666,8 +5668,9 @@ static void sg_load_sanitycheck(struct loaddata *loading)
 
   players_iterate(pplayer) {
     unit_list_iterate_safe(pplayer->units, punit) {
-      if (!unit_order_list_is_sane(&(wld.map), punit->orders.length,
-                                   punit->orders.list)) {
+      if (punit->has_orders
+          && !unit_order_list_is_sane(&(wld.map), punit->orders.length,
+                                      punit->orders.list)) {
         log_sg("Invalid unit orders for unit %d.", punit->id);
         free_unit_orders(punit);
       }
diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c
index d4b87af70c..ccd6122f73 100644
--- a/server/savegame/savegame3.c
+++ b/server/savegame/savegame3.c
@@ -6510,6 +6510,7 @@ static bool sg_load_player_unit(struct loaddata *loading,
           /* An invalid order. Just drop the orders for this unit. */
           free(punit->orders.list);
           punit->orders.list = NULL;
+          punit->orders.length = 0;
           punit->has_orders = FALSE;
           break;
         }
@@ -6609,6 +6610,7 @@ static bool sg_load_player_unit(struct loaddata *loading,
             /* Missing required action extra target. */
             free(punit->orders.list);
             punit->orders.list = NULL;
+            punit->orders.length = 0;
             punit->has_orders = FALSE;
             break;
           }
@@ -6634,6 +6636,7 @@ static bool sg_load_player_unit(struct loaddata *loading,
 
       punit->has_orders = FALSE;
       punit->orders.list = NULL;
+      punit->orders.length = 0;
 
       (void) secfile_entry_lookup(loading->file, "%s.orders_index", unitstr);
       (void) secfile_entry_lookup(loading->file, "%s.orders_repeat", unitstr);
@@ -8202,8 +8205,9 @@ static void sg_load_sanitycheck(struct loaddata *loading)
 
   players_iterate(pplayer) {
     unit_list_iterate_safe(pplayer->units, punit) {
-      if (!unit_order_list_is_sane(&(wld.map), punit->orders.length,
-                                   punit->orders.list)) {
+      if (punit->has_orders
+          && !unit_order_list_is_sane(&(wld.map), punit->orders.length,
+                                      punit->orders.list)) {
         log_sg("Invalid unit orders for unit %d.", punit->id);
         free_unit_orders(punit);
       }
