Commit 9ddf261
committed
Copy globalVarScopedMap entry on PlayerCharacter clone
PlayerCharacter.clone() invokes bean.copyContents(id, aClone.id) on every
facet, but AbstractItemFacet.copyContents() copies the underlying map
directly without going through set(), so ScopeFacet.set()'s side effect
of registering the GlobalPCVarScoped sentinel was skipped on the clone.
The cloned character then had a null entry in globalVarScopedMap, and
getGlobalScope() handed back a ScopeInstance whose owner was null,
causing NullPointerExceptions in VarScoped.getProviderFor() during the
26 pcGenGUI*Test save/restore flows.
Override copyContents() to also copy the globalVarScopedMap entry.1 parent bd9e821 commit 9ddf261
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
| |||
0 commit comments