Added a check before split().

In order to prevent the code from crashing if `expr` is `undefined` or `""`.