diff --git a/exec/avatars.js b/exec/avatars.js
index 25bc8b93931e6869a5796fb63bc7c2fad4a55051..e5cd9ae2b707febfd7ef95ef16ec050a4519455b 100644
--- a/exec/avatars.js
+++ b/exec/avatars.js
@@ -330,7 +330,7 @@ function export_users(msgbase, realnames, all)
 		var u = new User(n);
 		if((u.settings&USER_DELETED)
 			|| !u.stats.total_posts			// No need to export avatars for users that have never posted
-			|| (u.security_restrictions&(UFLAG_P|UFLAG_N|UFLAG_Q)) // or will never post
+			|| (u.security.restrictions&(UFLAG_P|UFLAG_N|UFLAG_Q)) // or will never post
 			) {
 			if(verbosity)
 				printf("User #%u hasn't or can't post, skipping\r\n", n);