Additional if statement check

Fixed project.activeLayer being null
Merge pull request #80 from tranek/develop

Additional if statement check