WPrefs: fix NULL pointer handling when getting the Modifiers (Coverity #50200)