Fix some cppcheck warnings

Bug 77800 - cppcheck reports
diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc
index e354f29..5ffc6b1 100644
--- a/src/hb-shape-plan.cc
+++ b/src/hb-shape-plan.cc
@@ -104,8 +104,6 @@
 		      unsigned int                   num_user_features,
 		      const char * const            *shaper_list)
 {
-  assert (props->direction != HB_DIRECTION_INVALID);
-
   hb_shape_plan_t *shape_plan;
   hb_feature_t *features = NULL;
 
@@ -120,6 +118,8 @@
     return hb_shape_plan_get_empty ();
   }
 
+  assert (props->direction != HB_DIRECTION_INVALID);
+
   hb_face_make_immutable (face);
   shape_plan->default_shaper_list = shaper_list == NULL;
   shape_plan->face_unsafe = face;