Ensure that variable exists
Merge pull request #31 from bramley/Mantis_17186

mantis 17186 - PHP notice about undefined index