You can do it by using a Thematic Rule. Trying to add an expression to a 'Feature Label' will not produce the desired results. (Note: There may be other ways to do this. This is one such way.)
From the Style Editor, you will create a 'theme' which will consist of two groups: (1)Not Null and (2)Null. You will label one group but not the other. This is how. Just follow the captions at the bottom if each image.
1-Open the style editor, click the ellipsis.
2-My 'Property' is thickness, denoted thick (your property may vary). Most times thick has a 'value' while other times, thick is BLANK.
3-The 'Operator' = Is Not Null.
4-When there are 'thick' values, the expression will look like this. To confirm, click VALIDATE.
5-This is first part of the theme. These entities will get labels, the second part will be label-less.
6-Click DUPLICATE to create a second entry. Click the ellipsis on the duplicate.
7-The Property is still 'thick.' This time, the 'Operator' = Is Null.
8-When 'thick' value is null, the expression will look like this. To confirm, click VALIDATE.
9-The style editor now looks like this.
10-If thick is 'Not Null' then you will make labels. You will NOT makes lables if Null.
11-This is final result. You can even 'stylize' not null to be a different color.
Chicagolooper
