Fix undefined index
Merge pull request #2618 from colemanw/master

Fix undefined index