Additional if statement check

Fixed project.activeLayer being null