Fix for crashes that occur when using selection tool and line tool

This commit is contained in:
Subhang Nanduri 2019-12-15 10:19:58 -05:00
parent 40dfe544d8
commit 632a0c8dd3
2 changed files with 4 additions and 3 deletions

View file

@ -256,7 +256,8 @@ func _process(delta : float) -> void:
is_making_line = true
elif Input.is_action_just_released("shift"):
is_making_line = false
line_2d.queue_free()
if is_instance_valid(line_2d):
line_2d.queue_free()
if is_making_line:
line_2d.set_point_position(1, mouse_pos)