handle null auth code and add tests for that
Merge pull request #326 from AzureAD/fix_nullexcep

handle null auth code and add tests for that