Hot answers tagged

1 vote

System NullPointerException on get from map

You may want to use the Safe Navigation Operator to avoid an extra null check. Also, see my talk on using containsKey and get efficiently. It's better to: Map<String,Map<String,Integer>> ...
sfdcfox's user avatar
  • 481k
1 vote
Accepted

System NullPointerException on get from map

Check whether the map is instantiated or not and if it is instantiated, you can use the containsKey method. Map<String,Map<String,Integer>> mapSoldAppStatus = reportPageController....
S1th's user avatar
  • 69

Only top scored, non community-wiki answers of a minimum length are eligible