Hello, No it's the contrary. The NPE doesn't happen despite the call to clearCaches(). The clearCaches() call solves the problem. In other words, without that call the NPE happens. The problem is probably as you suggest in your 3th paragraph here below.
Koen