AcceptDialog can not be paused

Godot Version

v4.3

Question

so i want to stop every thing so i use get_tree().paused = true and i don't want my AcceptDialog to be stopped so i try make process mode always but it doesnt work try to add that AcceptDialog.paused = false but it can't be paused from the start and it keep give me this error Invalid assignment of property or key 'paused' with value of type 'bool' on a base object of type 'null instance'.

extends Node

@onready var dialog: AcceptDialog = $AcceptDialog # Make sure to properly reference your dialog

func _ready():
# Set up the dialog to process even when paused
dialog.process_mode = Node.PROCESS_MODE_ALWAYS

# Optional: Set up a pause button/action
if Input.is_action_just_pressed("pause"):
    toggle_pause()

func toggle_pause():
# Toggle the game pause state
get_tree().paused = !get_tree().paused

if get_tree().paused:
    dialog.show()  # Show dialog when paused
else:
    dialog.hide()  # Hide dialog when unpaused

Example dialog callback

func _on_accept_dialog_confirmed():
# Handle dialog confirmation
get_tree().paused = false # Optionally unpause when dialog is confirmed