def update_null_primary(hdu_in, hdu=None):
    """ 'Update' a null primary HDU

    This actually just checks hdu exists and creates it from hdu_in if it does not.
    """
    if hdu is None:
        hdu = fits.PrimaryHDU(header=hdu_in.header)
    else:
        hdu = hdu_in
        hdu.header.remove('FILENAME')
    return hdu