-1

Crashlytics is showing a few crashes on the following line:

if(appObj.getStationsList().get(tag)!=null){

getStationsList() returns a LinkedHashMap<String, StationInfo>. How can I avoid getting this error? It's ironic that my very check to avoid this error actually resulted in it.

Luiggi Mendoza
  • 83,472
  • 15
  • 149
  • 315
codeman
  • 8,570
  • 12
  • 49
  • 77

2 Answers2

0

You will have to check:

if(appObj.getStationsList()==null)
f.leno
  • 149
  • 7
0

replace

if(appObj.getStationsList().get(tag)!=null){

with

 if(appObj.getStationsList() !=null && appObj.getStationsList().get(tag)!=null){

}
Macrosoft-Dev
  • 2,157
  • 1
  • 9
  • 15