Trying to get property of non-object

Error:

$get_option_id = get_post($my_id);
$content = $get_option_id->post_content;


Fix
$get_option_id = get_post($my_id);
if(is_array($get_option_id)){
$content = $get_option_id->post_content;
}