defold / defold/defold

Projects with invalid game.project contents should still open and work

Open
#12,809 0 comments 0 reactions 0 assignees View on GitHub
bug editor
Dominant language
C++
Stars
6.3k
Forks
455
Avg merge
2d 2h
Merged PRs (30d)
129

Description

**Describe the bug (REQUIRED)**
If a user has invalid `game.project` content (which may appear, for example, as a result of a merge conflict), the editor crashes when trying to open it.

**To Reproduce (REQUIRED)**
Steps to reproduce the behavior:
1. Open any `game.project` file and add `MUAHAHA!!!` at the end
2. Try to open the project in the editor

The editor crashes with the error:
```
java.lang.Exception: Invalid setting line: MUAHAHA!!!
at editor.settings_core$parse_error.invokeStatic(settings_core.clj:75)
at editor.settings_core$parse_error.invoke(settings_core.clj:74)
at editor.settings_core$parse_settings$fn__30033.invoke(settings_core.clj:99)
at clojure.core$filter$fn__5977$fn__5978.invoke(core.clj:2823)
at clojure.core$map$fn__5950$fn__5951.invoke(core.clj:2759)
at clojure.core.protocols$fn__8275.invokeStatic(protocols.clj:167)
at clojure.core.protocols$fn__8275.invoke(protocols.clj:123)
at clojure.core.protocols$fn__8229$G__8224__8238.invoke(protocols.clj:19)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
at clojure.core.protocols$fn__8260.invokeStatic(protocols.clj:74)
at clojure.core.protocols$fn__8260.invoke(protocols.clj:74)
at clojure.core.protocols$fn__8203$G__8198__8216.invoke(protocols.clj:13)
at clojure.core$transduce.invokeStatic(core.clj:7026)
at clojure.core$transduce.invoke(core.clj:7012)
at editor.settings_core$parse_settings.invokeStatic(settings_core.clj:89)
at editor.settings_core$parse_settings.invoke(settings_core.clj:88)
at editor.defold_project$read_dependencies.invokeStatic(defold_project.clj:1823)
at editor.defold_project$read_dependencies.invoke(defold_project.clj:1821)
at editor.defold_project$open_project_BANG_.invokeStatic(defold_project.clj:1893)
at editor.defold_project$open_project_BANG_.invoke(defold_project.clj:1892)
at editor.boot_open_project$open_project_BANG_.invokeStatic(boot_open_project.clj:456)
at editor.boot_open_project$open_project_BANG_.invoke(boot_open_project.clj:447)
at clojure.lang.Var.invoke(Var.java:426)
at editor.boot$open_project_with_progress_dialog$fn__63176.invoke(boot.clj:91)
at editor.dialogs$make_load_project_dialog$fn__41279$fn__41282.invoke(dialogs.clj:503)
at clojure.core$binding_conveyor_fn$fn__5842.invoke(core.clj:2047)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
```

**Expected behavior (REQUIRED)**
I expected the project to be openable and failing compilation.

**Defold version (REQUIRED):**
- latest

**Platforms (REQUIRED):**
- editor

**Repro project**

[invalid-game-project.zip](https://github.com/user-attachments/files/30270316/invalid-game-project.zip)

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with the attached invalid-game-project.zip, then start in editor.settings_core.clj at parse_settings and follow the call into editor.defold_project.clj's open_project! path. Verify that an invalid game.project no longer crashes project opening and that compilation still fails as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.