<commit_before>'use strict';

angular.module('nearby').controller('BreweryController', ['$scope', 'Brewery', '$stateParams', 
  function($scope, Brewery, $stateParams) {
    // Brewery controller logic
    $scope.breweryId = $stateParams.breweryId;
    var holdSocial = [];
    
    Brewery.getData($scope.breweryId).success(function(results, status) {
      $scope.brewery = results.data || 'Request failed';
      for (var i = 0; i < $scope.brewery.socialAccounts.length; i++) {
        // only save the social media sites that are FB, Twitter, 4Square, 
        // Google+, YouTube, Instagram, Yelp or Pinterest
        var tempSocial = $scope.brewery.socialAccounts[i];
        if ([1,2,3,8,10,14,15,16].indexOf(tempSocial.socialMediaId) > -1) {
          holdSocial.push(tempSocial);
        }
      }
      $scope.socialMedia = holdSocial;
    });
  }
]);<commit_msg>add condition to handle no social media<commit_after>'use strict';

angular.module('nearby').controller('BreweryController', ['$scope', 'Brewery', '$stateParams',
  function($scope, Brewery, $stateParams) {
    // Brewery controller logic
    $scope.breweryId = $stateParams.breweryId;
    var holdSocial = [];

    Brewery.getData($scope.breweryId).success(function(results, status) {
      $scope.brewery = results.data || 'Request failed';

      if ($scope.brewery.socialAccounts){
        for (var i = 0; i < $scope.brewery.socialAccounts.length; i++) {
          // only save the social media sites that are FB, Twitter, 4Square,
          // Google+, YouTube, Instagram, Yelp or Pinterest
          var tempSocial = $scope.brewery.socialAccounts[i];
          if ([1,2,3,8,10,14,15,16].indexOf(tempSocial.socialMediaId) > -1) {
            holdSocial.push(tempSocial);
          }
        }
        $scope.socialMedia = holdSocial;
      }
    });
  }
]);
{'fraction_non_alphanumeric': 0.14877384196185287, 'fraction_numerical': 0.01634877384196185, 'mean_word_length': 3.070953436807095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5999559', 'n_tokens_mistral': 601, 'n_tokens_neox': 564, 'n_words': 118}