Fix compiler warnings for Ticket 47395 and 47397
Ticket 47395 47397 v2 correct behaviour of account policy if only stateattr
is configured or no alternate attr is configured
(cherry picked from commit ce4e813f3f446bdd746ec288f33d1effcb3bf919)
(cherry picked from commit 2bd9ced46f395513e0aaded8f8eea5962337bffc)