Testing for a shortcode using a function. 404 page throwing PHP Notice

Try this instead:

function has_shortcode($shortcode="") {
  global $post;
 // false because we have to search through the post content first
 $found = false;

 // if no short code was provided, return false
 if ( !$shortcode ) {
    return $found;
 }

 if (  is_object( $post ) && stripos( $post->post_content, '[' . $shortcode ) !== false ) {
     // we have found the short code
  $found = true;
 }

// return our final results
return $found;
}