Undefined index error if you setFlash to invalid type

If you setFlash to anything that is not in the $alertTypes array it will throw an undefined index error.