modrepo: check for this == NULL in methods

because constructor returns NULL when no modules are found...