(contents (package--read-archive-file contents-file)))
(when contents
(dolist (package contents)
- (package--add-to-archive-contents package archive)))))
+ (if package
+ (package--add-to-archive-contents package archive)
+ (lwarn '(package refresh) :warning
+ "Ignoring `nil' package on `%s' package archive" archive))))))
(defvar package--old-archive-priorities nil
"Store currently used `package-archive-priorities'.
(search-forward-regexp "^ +simple-single" nil t))))
(if (process-live-p process) (kill-process process)))))
+(ert-deftest package-test-update-archives/ignore-nil-entry ()
+ "Ignore any packages that are nil. Test for Bug#28502."
+ (with-package-test ()
+ (let* ((with-nil-entry (expand-file-name "package-resources/with-nil-entry"
+ package-test-file-dir))
+ (package-archives `(("with-nil-entry" . ,with-nil-entry))))
+ (package-initialize)
+ (package-refresh-contents)
+ (should (equal (length package-archive-contents) 2)))))
+
(ert-deftest package-test-describe-package ()
"Test displaying help for a package."