Index: src/wp-includes/class-wp-hook.php
===================================================================
--- src/wp-includes/class-wp-hook.php	(revision 41985)
+++ src/wp-includes/class-wp-hook.php	(working copy)
@@ -288,7 +288,7 @@
 					$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
 				}
 			}
-		} while ( false !== next( $this->iterations[ $nesting_level ] ) );
+		} while ( ! is_null( $this->iterations[ $nesting_level ] ) && false !== next( $this->iterations[ $nesting_level ] ) );
 
 		unset( $this->iterations[ $nesting_level ] );
 		unset( $this->current_priority[ $nesting_level ] );
@@ -331,7 +331,7 @@
 			foreach ( $this->callbacks[ $priority ] as $the_ ) {
 				call_user_func_array( $the_['function'], $args );
 			}
-		} while ( false !== next( $this->iterations[ $nesting_level ] ) );
+		} while ( ! is_null( $this->iterations[ $nesting_level ] ) && false !== next( $this->iterations[ $nesting_level ] ) );
 
 		unset( $this->iterations[ $nesting_level ] );
 		$this->nesting_level--;
