Verified Commit 77b70d72 authored by Erick Hitter's avatar Erick Hitter
Browse files

Requesting the first page, even of any empty set, shouldn't be considered an error

Corrects a bug introduced in ad4a5420
Fixes #67
parent 82f3bf02
......@@ -18,7 +18,8 @@ class Events extends \WP_CLI_Command {
$events = $this->get_events( $args, $assoc_args );
// Prevent one from requesting a page that doesn't exist
if ( $events['page'] > $events['total_pages'] ) {
// Shouldn't error when first page is requested, though, as that is handled below and is an odd behaviour otherwise
if ( $events['page'] > $events['total_pages'] && $events['page'] > 1 ) {
\WP_CLI::error( __( 'Invalid page requested', 'automattic-cron-control' ) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment