- Close detector's filestream, handle null mediatypes.