I have a function, f[dist_, samp_]:=somework[dist, samp] that I want to return `Null`, or zero if passed a null distribution. I can't find a way to test for a difference between `Null` and Data distribution, none of `===`, `=!=`, `SameQ` and `==` can identify them. How can I tell if I'm being passed a `Null` value to handle it correctly? f[dist_, samp_]:=something[dist, samp] /; TrueQ[dist==DataDistribution] Seems to be close to what I want. Here's my function. If probKern is a Null, I want to return a Null, otherwise, I want to calculate the PDF for the sample, with the distribution. I can't quite get a handle on matching the types to make this work though. calcPDF[probKern_, samp_] := Null /; TrueQ[probKern != DataDistribution] calcPDF[probKern_Symbol, samp_] := PDF[probKern, samp] /; TrueQ[probKern == DataDistribution]