<commit_before>import Ember from 'ember'
import { PropTypes } from 'ember-prop-types'
import layout from '../templates/components/frost-icon'
import _ from 'lodash'

const { Component, deprecate } = Ember

export default Component.extend({
  classNames: 'frost-icon',
  layout: layout,
  propTypes: {
    pack: PropTypes.string,
    icon: PropTypes.string.isRequired
  },
  tagName: 'svg',

  didReceiveAttrs ({newAttrs}) {
    deprecate(
      'nested icon paths have been deprecated in favor of flat icon packs',
      !_.includes(newAttrs.icon.value, '/'),
      {
        id: 'frost-debug.deprecate-nested-icon-paths',
        until: '1.0.0',
        url: 'http://ciena-frost.github.io/ember-frost-core/#/icons'
      }
    )
  },

  getDefaultProps () {
    return {
      pack: 'frost'
    }
  }
})
<commit_msg>Added a null check to icon path deprecation check<commit_after>import Ember from 'ember'
import { PropTypes } from 'ember-prop-types'
import layout from '../templates/components/frost-icon'
import _ from 'lodash'

const { Component, deprecate } = Ember

export default Component.extend({
  classNames: 'frost-icon',
  layout: layout,
  propTypes: {
    pack: PropTypes.string,
    icon: PropTypes.string.isRequired
  },
  tagName: 'svg',

  didReceiveAttrs ({newAttrs}) {
    deprecate(
      'nested icon paths have been deprecated in favor of flat icon packs',
      !_.includes(_.get(newAttrs, 'icon.value'), '/'),
      {
        id: 'frost-debug.deprecate-nested-icon-paths',
        until: '1.0.0',
        url: 'http://ciena-frost.github.io/ember-frost-core/#/icons'
      }
    )
  },

  getDefaultProps () {
    return {
      pack: 'frost'
    }
  }
})

{'fraction_non_alphanumeric': 0.13988095238095238, 'fraction_numerical': 0.0035714285714285713, 'mean_word_length': 2.8555045871559632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1337845', 'n_tokens_mistral': 569, 'n_tokens_neox': 561, 'n_words': 127}