You're missing the exception code at the end of the line. The code is numeric - or for some exceptions has a named constant.
The syntax of the command is
sxe -c "" <code>
So in your case it should probably be
sxe -c "!soe System.NullReferenceException 1;
.if (@$t1 == 1) { .dump /ma /u c:\tmp\NullReferenceException.dmp; gn }
.else { gn }" clr
Note the clr at the end of the command.