I am making an http request, but as I have 2 buttons, one which scans a qr code and the other where I make a query with the scanned result where my query code is:
In case it is null or it is not in the database, I have put the following validation
But especially it marks me an error where I do this.resultadoBD[0]["sociedad"] == null
it because it tells me that it is not a valid valueRangeError (index): Invalid value: Valid value range is empty: 0
The problem is that DBresult is empty, that's why it throws you the exception when validating.
You also have another bad validation,
this.resultadoBD.length <0
, the size will never be less than 0.You could do the validation like this: