Problem/Motivation
Drupal\file\IconMimeTypes
cannot handle NULL value for mimetype well. Errors out pages with file references to file with NULL as the mimetype.
Steps to reproduce
Attempt to view or edit a page with a file reference to a file with NULL as the mimetype, where a variable icon is expected to display.
Instead you'll get a white error page, with watchdog errors, e.g., TypeError: Drupal\file\IconMimeTypes::getIconClass(): Argument #1 ($mimeType) must be of type string, null given ...
Proposed resolution
The problem is that the database table file_managed allows NULL for the filemime column, but the internal methods of Drupal\file\IconMimeTypes
require strings and can't handle NULL at all.
The signatures should be altered to allow NULL values, and to handle them gracefully, as did the file_icon_class()
function this class replaces.