Add check on array key to prevent "undefined index" error
Merge pull request #27 from trascopur/patch-2

Add check on array key to prevent "undefined index" error