Fix the anon user check logic for adding optional modules

Regression from f4a227be

Change-Id: I0989c7d6147fb417c1675d2b1843127d754d81b1
Merge "Fix the anon user check logic for adding optional modules"