Since the only actual access to a reference here is client
, then in here the problem is client
is null
.
Your stacktrace could actually have shown you that the method you thought is responsible, is not actually called.
As a side note, you should avoid using raw types (ArrayList
), and try to stick with generics (ArrayList<SomeClass>
).