Skip to content

tiled crash when trying to select an object in warn/error callback from issues view #4189

@thmsndk

Description

@thmsndk

Describe the bug
When registering a callback for tiled.warn or tiled.error and clicking on it in the issue tab tiled crashes when setting selected or trying to change selectedObjects

tiled.warn("test", function () {
	if (obj) {
		// First select the object
                obj.map.selectedObjects = [];
		obj.map.selectedObjects.push(obj);
		// obj.layer.selected = true;
		// obj.selected = true;

		// Then center the view on it
		tiled.mapEditor.currentMapView.centerOn(obj.x + obj.width / 2, obj.y + obj.height / 2);
	}
});

To Reproduce
Steps to reproduce the behavior:

  1. Go to the issues tab
  2. Double Click on 'the warning or error
  3. tiled crashes to desktop with no error

Expected behavior
That the object would be selected in the tiled editor

Specifications:

  • OS: Windows 11
  • Tiled Version: 1.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBroken behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions