ivaynberg/select2 — pull request #397 by kchung (2012-09-10 02:13:56+00:00)
Title: Prevent formatSelection for erroring when accessing an empty select input.

When a Select2 input is initialized without any values, programmatically attempting to access a value (e.g `$("#no-value-select").select2("val", 1)`) will throw an error when using the default `formatSelection` function.

Added a condition to check if `data` exists first before trying to return `data.text`.