I am using API to get text and value for grafana variable , sometimes the API returns NULL, NULL for text and value then grafana gives react error

I am using API to get text and value for grafana variable , sometimes the API returns NULL, NULL for text and value then grafana gives react error. Is there any way i can handle these null values for variables in grafana
Example to response from API
[{“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: null, “value”: null}, {“text”: “100”, “value”: “100”}, {“text”: “100”, “value”: “100”}]
I want variable value in the dropdown to be 100, where as it is giving error.
image