if no errors in array, use top-level message for error parsing

This commit is contained in:
Brendan Forster
2015-01-02 15:48:19 +09:30
parent 99239636f6
commit b73775b9aa
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Octokit
public static string FirstErrorMessageSafe(this ApiError apiError)
{
if (apiError == null) return null;
if (apiError.Errors == null) return null;
if (apiError.Errors == null) return apiError.Message;
var firstError = apiError.Errors.FirstOrDefault();
if (firstError == null) return null;
return firstError.Message;