Azure / azure-storage-ruby

Microsoft Azure Storage Library for Ruby
http://azure.github.io/azure-storage-ruby/
82 stars 158 forks source link

Passing invalid connection string raises `NoMethodError` - undefined method `<' for nil:NilClass: #187

Closed mattt closed 2 years ago

mattt commented 3 years ago

Calling #create_from_connection_string and passing an arbitrary or empty string causes parse_connection_string to raise an error.

require 'azure/storage/blob'
Azure::Storage::Blob::BlobService.create_from_connection_string("invalid")

This underlying issue is that calling String#index with a character not contained in the string returns nil, and < is an undefined method on nil.

https://github.com/Azure/azure-storage-ruby/blob/05ea58af3859edda790e769be5beba7fcfb73c0f/common/lib/azure/storage/common/client_options.rb#L351