diff --git a/sedkit/sed.py b/sedkit/sed.py index 0384fa3e..9b9e8f0c 100755 --- a/sedkit/sed.py +++ b/sedkit/sed.py @@ -280,8 +280,8 @@ def add_photometry(self, band, mag, mag_unc=None, system='Vega', ref=None, **kwa if not isinstance(mag_unc, (float, np.float32, type(None), np.ma.core.MaskedConstant)): raise TypeError("{}: Magnitude uncertainty must be a float, NaN, or None.".format(type(mag_unc))) - # Make NaN if 0 - if (isinstance(mag_unc, (float, int)) and mag_unc == 0) or isinstance(mag_unc, np.ma.core.MaskedConstant): + # Make NaN if 0 or None + if (isinstance(mag_unc, (float, int)) and mag_unc == 0) or isinstance(mag_unc, (np.ma.core.MaskedConstant, type(None))): mag_unc = np.nan # Get the bandpass