Inserted an if to prevent php warnings
Merge pull request #9 from func0der/upstream

Inserted an if to prevent php warnings