by Darko Miletić.
Be also careful with that check and make sure it does not prevent module from being installed. During module installation Moodle will detect and offer settings for a user to set of a new module. If there are no defaults and user does not enter anything Moodle will not stop showing them until some resonable value is entered by the user. This also screws CLI installations/upgrades.