topic: fix the newly added cache for repository without topic
The context method might be wrapped without topic being installer. So we need to deal with that case.
The context method might be wrapped without topic being installer. So we need to deal with that case.