-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
  • 85,076
  • 16
  • 154
  • 332
codeman
  • 8,868
  • 13
  • 50
  • 79

2 Answers2

0

You will have to check:

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

replace

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

with

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

}
Macrosoft-Dev
  • 2,195
  • 1
  • 12
  • 15