getting error "in base 'null instance' on a null instance."

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By shachar1236

I made a fire ball that my player can shoot and i made a enemy that can also shoot fire ball.
I made that the fire ball has a life and velocity and when he meet another fire he adding accelaration to the other fire ball and subtracting its velocity.
So when two fire balls meet the boths stay in the same place but moving a little and both of their life get reduce and when they life riches zero the both should disappier.
But its giving me this error.
I think its giving me this error because the dissapier at the same time so when one dissapier the other still thinks its exists and call a function on him.
How can i fix this?

fire ball code:

extends KinematicBody2D
onready var hurtbox = $hurtbox
var acc : float = 400.0
var facing : int = 1
var damage = 15
var techniqueDamage = 50
var controller = TechniqueSceneHandler.new()
#func _ready():
#	print("use")
func _physics_process(delta):
	var areas = hurtbox.get_overlapping_areas()
	for area in areas:
		if area.name == "hitbox":
			var parent = area.get_parent()
			if parent != self:
				if parent.is_in_group("Technique") and parent != null:
					print("here")
					parent.controller.addForce(Vector2.RIGHT * acc * facing)
					parent.controller.subtractLife(techniqueDamage * delta)
	updateFlip()
	controller.addForce(Vector2.RIGHT * acc * facing)
	controller.update(delta)
	controller.velocity = move_and_slide(controller.velocity)
	
func updateFlip():
	scale.x = scale.y * facing
func _on_Timer_timeout():
	queue_free()
func get_damage() -> float:
	return damage
func _on_hurtbox_area_entered(area):
	if area.name == "hitbox":
		var parent = area.get_parent()
		if parent != self:
			if parent.is_in_group("Technique") and parent != null:
				parent.controller.velocity = Vector2.ZERO

Never mind, i was able to solve this

shachar1236 | 2020-12-16 16:36