<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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