Fix NPE when registrations is null

Looks like this is fixed in master, but we're running into this on 3.2.4. It'd be awesome if you could merge or backport the fix from master.