resolved undefined method `[]' for nil:NilClass for netmask

NoMethodError
-------------
undefined method `[]' for nil:NilClass

Relevant File Content:
----------------------
/root/chef-solo/cookbooks-3/squid/recipes/default.rb:

 19:  # limitations under the License.
 20:  #
 21:
 22:  # variables
 23:  ipaddress = node['ipaddress']
 24:  listen_interface = node['squid']['listen_interface']
 25:  version = node['squid']['version']
 26>> netmask = node['network']['interfaces'][listen_interface]['addresses'][ipaddress]['netmask']
 27: