Why is this script not working?

I have used this script many times before but now its not working. I select the entity in editor but just gives me “Uncaught TypeError: Cannot set properties of null (setting ‘enabled’)” Can anybody help?

var ZombieTrigger = pc.createScript('zombieTrigger');
ZombieTrigger.attributes.add('Zombie', {type : 'entity'});

// initialize code called once per entity
ZombieTrigger.prototype.initialize = function() {
    this.entity.collision.on('collisionstart', this.onCollisionStart, this);
};

//Contact
ZombieTrigger.prototype.onCollisionStart = function(result) {
    if (result.other.name == 'Player') {
        this.Zombie.enabled = true;
    }
};

// update code called every frame
ZombieTrigger.prototype.update = function(dt) {

};

// swap method called for script hot-reloading
// inherit your script state here
// ZombieTrigger.prototype.swap = function(old) { };

// to learn more about script anatomy, please read:
// https://developer.playcanvas.com/en/user-manual/scripting/

@PhilipJeffrey I am not sure if you can share your project or not. Also, I am not sure if you have access to this.Zombie inside this callback but what you could do is put a console.log inside the if and log this.Zombie. You will be able to see inside the inspector if the object is there.

I will test that out.

Are you sure you assigned an entity to the attribute?