We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
We should be checking for a valid post being available before we pass values into the class, not inside the class itself.
This would basically just be a case of moving the get_post() call out, and doing perhaps some is_wp_error checks first.
is_wp_error