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>> ...
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....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
map × 901apex × 638
list × 143
trigger × 116
visualforce × 94
soql × 79
json × 45
set × 37
loop × 36
collection × 35
javascript × 34
sobject × 34
lightning-aura-components × 33
lightning-web-components × 23
query × 18
wrapper-class × 18
class × 17
bulkification × 17
deserialize × 17
unit-test × 16
aggregateresult × 15
before-trigger × 14
string × 14
batch × 13
custom-object × 13