mapeditor / mapeditor/tiled

Crash when importing a custom type with list<enum>

Open
#4,570 2 comments 0 reactions 1 assignee View on GitHub

@bjorn is already working on this.

Since Jul 19, 2026.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

Describe the bug

Tiled crashes when loading an external custom types export which contains a type with:

  • an enumerate
  • a list containing the same enumerate
  • a boolean
  • a list of boolean

(not sure about the exact combination though)

Steps to reproduce
  1. Create new Tiled project
  2. Open custom types editor and create a new custom type like so:
Image
  1. Export custom types to an external file (reference_export.json)
  2. Close Tiled
  3. Open Tiled and create a new project
  4. Load the custom types export (reference_export.json)
  5. It loads fine, custom types editor is still open
  6. In custom types editor, click on "TopLevelType" definition
  7. Tiled application crashes
  8. Re-open the same Tiled project
  9. A warning is displayed saying there is a circular reference
Image
  1. Open custom types editor and navigate to "TopLevelType" definition again
  2. It does not crash but "list_of_enums" field does not contain anything

For reference, here is the export file causing the issue: reference_export.json

For reproduction, I believe you can start at step n°5 and just load the export file.

Expected behavior

We should be able to load this kind of file.
At least, application should not crash.

OS version

Windows 11

Tiled version

1.12.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.