I think I solved the bug. I’m not sure about this code want to do but casting the null value (from $wp_query->get( ‘posts_per_page’ )) to (int) it can execute the Multiplication Operator.
$last = min( $total, (int)$wp_query->get( 'posts_per_page' ) * $paged );