[repacker] ensure lookup map is updated when lookup memory location changes.
diff --git a/src/graph/graph.hh b/src/graph/graph.hh
index b0b6df7..a73d86f 100644
--- a/src/graph/graph.hh
+++ b/src/graph/graph.hh
@@ -291,12 +291,12 @@
 
     check_success (!queue.in_error ());
     check_success (!sorted_graph.in_error ());
-    if (!check_success (new_id == -1))
-      print_orphaned_nodes ();
 
     remap_all_obj_indices (id_map, &sorted_graph);
-
     hb_swap (vertices_, sorted_graph);
+
+    if (!check_success (new_id == -1))
+      print_orphaned_nodes ();
   }
 
   /*