@@ -99,8 +99,11 @@ function () {
99
99
}
100
100
}
101
101
);
102
- if ( 'hook ' === $ this ->type
103
- && ':before ' === substr ( $ this ->focus , -7 , 7 ) ) {
102
+ if (
103
+ 'hook ' === $ this ->type &&
104
+ $ this ->focus &&
105
+ ':before ' === substr ( $ this ->focus , -7 , 7 )
106
+ ) {
104
107
$ stage_hooks = array ();
105
108
foreach ( $ this ->stage_hooks as $ hooks ) {
106
109
$ stage_hooks = array_merge ( $ stage_hooks , $ hooks );
@@ -114,8 +117,11 @@ function () {
114
117
WP_CLI ::add_hook ( 'after_wp_config_load ' , array ( $ this , 'wp_tick_profile_begin ' ) );
115
118
}
116
119
WP_CLI ::add_wp_hook ( $ end_hook , array ( $ this , 'wp_tick_profile_end ' ), -9999 );
117
- } elseif ( 'hook ' === $ this ->type
118
- && ':after ' === substr ( $ this ->focus , -6 , 6 ) ) {
120
+ } elseif (
121
+ 'hook ' === $ this ->type &&
122
+ $ this ->focus &&
123
+ ':after ' === substr ( $ this ->focus , -6 , 6 )
124
+ ) {
119
125
$ start_hook = substr ( $ this ->focus , 0 , -6 );
120
126
WP_CLI ::add_wp_hook ( $ start_hook , array ( $ this , 'wp_tick_profile_begin ' ), 9999 );
121
127
} else {
0 commit comments