C# API Client 2.14.0: StringBatchOperations fires a System.NullReferenceException


We’re currently working on the C# Crowdin API’s StringBatchOperations and we faced this issue:

    "ClassName": "System.NullReferenceException",
    "Message": "Object reference not set to an instance of an object.",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": "   at Crowdin.Api.Core.JsonParser.ParseResponseObject[TData](JToken token)\r\n   at Crowdin.Api.Core.JsonParser.ParseResponseList[TData](JObject rootElement)\r\n   at Crowdin.Api.SourceStrings.SourceStringsApiExecutor.StringBatchOperations(Int32 projectId, IEnumerable`1 patches)\r\n   at Criteo.TranslationsManager.Services.CrowdinClientWrapper.BulkEditSourceStrings(Int32 projectId, List`1 patches) in C:\\dev\\repos\\translation-manager-bis\\webapps\\translations-manager\\Criteo.TranslationsManager\\Services\\CrowdinClientWrapper.cs:line 77\r\n   at Criteo.TranslationsManager.Services.SourceStringService.BulkEditSourceStrings(Int32 projectId, List`1 request) in C:\\dev\\repos\\translation-manager-bis\\webapps\\translations-manager\\Criteo.TranslationsManager\\Services\\SourceStringService.cs:line 56\r\n   at Criteo.TranslationsManager.Controllers.SourceStringController.BulkEditSourceStrings(Int32 projectId, List`1 patches) in C:\\dev\\repos\\translation-manager-bis\\webapps\\translations-manager\\Criteo.TranslationsManager\\Controllers\\SourceStringController.cs:line 94",
    "RemoteStackTraceString": null,
    "RemoteStackIndex": 0,
    "ExceptionMethod": null,
    "HResult": -2147467261,
    "Source": "Crowdin.Api",
    "WatsonBuckets": null

When debugging, we saw that the endpoint response (in the SourceStringsApiExecutor) had 200OK Status but the line _jsonParser.ParseResponseList<SourceString>(crowdinApiResult.JsonObject); fails to return an object with type ResponseList<SourceString>.

Another detail that could be useful, the result jsonObject only contains the property Data but is missing the Pagination object.

Thanks for your help !

1 Like

With old version all works fine? It’s only the issue with your setup on 2.14.0 for C#, right? Haven’t you change any part of setup during update?

I’m not sure about your client, but for example for CLI there’s a posibility to contribute. If you debug your issue and see some things that may speed up debuggin’ or solve the problem I’d suggest you to find related to your api client topic in Github and submit the report there, so developers can see it directly

1 Like