Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent NRE when Android SDK is not found (#73)
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/938504 In dc00a39, we added a search path for the NDK which is now *inside* the Android SDK. However, this change could produce a `NullReferenceException` if the Android SDK is not found. In cases where an Android SDK is not found, and the `AndroidSdkPath` property is null, we still go on to use the null property when locating the Android NDK: var sdks = GetAllAvailableAndroidSdks().ToList(); sdks.Add(AndroidSdkPath); foreach(var sdk in sdks.Distinct()) if (Directory.Exists(ndk = Path.Combine(sdk, "ndk-bundle"))) The `Path.Combine` will throw if you pass in a null. This fix doesn't *solve* the exception, as you will still get an `InvalidOperationException` for the missing Android SDK. However, that is certainly a more descriptive error message than a `NullReferenceException`.
- Loading branch information