zenchild/Viewpoint — pull request #74 by JanAhrens (2013-05-15 12:57:48+00:00)
Title: Support ErrorInvalidSmtpAddress case for get_user_availability

When requesting the availability of unknown users with [EWSClient#get_user_availability](https://github.com/zenchild/Viewpoint/blob/57f4e02e622aaba1e475d567c0f237262e033239/lib/ews/mailbox_accessors.rb#L52), the current code fails with `NoMethodError: undefined method '[]' for nil:NilClass`.

The current method assumes that the `response_message` and `response_code` are the first element in the list, which is correct for successful answers, but fails in the `ErrorInvalidSmtpAddress` response case.

The attached code changes this assumption and should also work for other error situations. I wrote a test that shows an example of the `ErrorInvalidSmtpAddress` error case.