fixes #177

Guard to check for the presence of nil. See this ticket https://github.com/aws/aws-sdk-core-ruby/issues/177.