In cleanExpiredResources the slice for the key to be deleted was getting fetched from getSliceForResource which would create a slice if it is not present in the state for that particular type. This was creating an issue as calling deleteResourceKey when type is not available in data would create a null exception.
In this PR added a check if type & key exist in state only then delete the key from state.
In
cleanExpiredResources
the slice for thekey
to be deleted was getting fetched fromgetSliceForResource
which would create a slice if it is not present in thestate
for that particulartype
. This was creating an issue as callingdeleteResourceKey
whentype
is not available indata
would create a null exception. In this PR added a check iftype
&key
exist in state only then delete thekey
from state.