Runtime error "java.util.List.iterator() on a null object reference"

An app installed on 20 smartphones works correctly, on the 21st it crashes abruptly and returns the following error

Runtime Error
Attempt to invoke interface method ‘java.util Iterator java.util.List.iterator ()’ on a null object reference

All smartphones are same brand / model (Samsung A10), have the same version of Android, the 9, and the same number of programs loaded
The error occurs when the main screen is loaded and execution is interrupted
Firebase, Timer, and other extensions are used in the program
Failing to perform a step-by-step debug I would not know how to intervene to understand the reason for the error reported
What can I do to understand the problem and correct it?

Are you loading a list from Firebase on initialisation ?
Could be this is not happening for some reason?
Put in a condition if list is not loaded?

Also, what about the 22nd phone ?

What might be different (settings) about the 21st phone ?

No, no list is loaded
Firebase is used only through the DataChanged event to read commands that are sent from a PC and arrive to the app on a smartphone

The other smartphones, with the exact same app, do not have this problem
The main screen starts correctly
Same hardware model, same Android loaded

Could the 22nd phone be failing because some resource has been exhausted by the 21 other phones before it?

  • DHCP addresses on the local router?
  • key unique values on the Firebase data model?
  • cumulative bandwidth or usage limits?

Can you post the blocks for Screen1.Initialize?
Also post transition to the "main screen" and
"main screen".initialize blocks.

No can’t be a resource, because the problem exist also when ONLY 22nd phone is powered

Yes, sure
When app run Screen1 is started
On Screen 1 there is only one button cmdVai
When Screen1 is initialized, then screen Mezzi is started
On init_ambiente, values are assigned to variables
The firebase_reset_initiale block is shown below
The telephone_right_9 procedure is also reported, which extrapolates the 9 right characters of a string containing a telephone number

block_screen1


Looking at your blocks, I see a vulnerability in the telephono_right_9 value procedure if the TinyDB tag numero_Telephono exists but has a value with string length less than 9. The segment call would crash.
That procedure result is immediately after used as a tag for a Firebase call.

I suggest some Do It Companion testing to see the values in TinyDB for that device.

You do not show all the procedures that are called…

init_ambiente
aggioma_titolo_screen
vai_a_screen_attuale
setta_colore_tasto

Are all the permission calls disabled ?

The problem appear also when app is newly installed
Then 'ValueifTagNotThere' should be picked (i think)
But yes, this point can be a potential vulnerability, then must be modified

init_ambiente is for set global variables
anyway

block_init_ambiente

block_vai_a_sceen_attuale

block_setta_colore_tasto

Now we need your global init values too.

Why not just export the .aia file and post it here?

I can’t do it, the software is developed on behalf of a client
And there is a confidentiality agreement on the procedures provided
It is one thing to describe some functions, another thing is to make the whole code public

We still need to see the global inits, at least for color value variables, to check data types.

Here’s a black box test for you in the meantime …

Does the 22nd device have Internet access the same as the other devices, at the site where it will be used?

22nd device has exactly the same internet access (via wifi) than other devices

variabili_global

See the Debugging FAQ at FAQ Section: Debugging for techniques you can apply to your proprietary app.