Facebook检测用户就像我的粉丝页面

What I want to do is check user go in my app before must like my fan page, I had a problem some user are successfully, but some user are not successfully

if this user without find friends, it's not working with my code

enter image description here

if this user with find friends, it's successfully working

enter image description here

Isn't this is facebook bug or my code problem or because of new user and old user?

here is my code to detect user already like my fan page

 $user = $facebook->getUser();

    if ($user) {
      try {
        $likes = $facebook->api("/me/likes/mypageid");
        //var_dump($likes);
        //exit;
        if( empty($likes['data']) ){
          ?>
          <script type='text/javascript'>top.location.href = 'https://www.facebook.com/testing';</script>

          <?php
              exit;
          }

      } catch (FacebookApiException $e) {
        error_log($e);
        $user = null;
      }
    } 

Thanks