After reparenting the LightmapGI node, the following `node` would be initialized to null: Node *node = get_node(light_data->get_user_path(i)); Which would then crash when de-referenced further down. This fix detects which the node has been reparented and clears its users.