Add a case for undefined.
case undefined:
// code
break;
Or, if all other options are exhausted, use the default.
default:
// code
break;
Note: To avoid errors, the variable supplied to switch has to be declared but can have an undefined value. Reference this fiddle and read more about defined and undefined variables in JavaScript.