Skip to content

Commit

Permalink
CDB: Fix crash on renaming column with reference on it
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVgr committed Dec 18, 2024
1 parent bd45972 commit fa4254b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hide/comp/cdb/Editor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,16 @@ class Editor extends Component {
beginChanges(true);
var err;
if( col != null ) {
base.mapType(function(t) {
return switch( t ) {
case TRef(o) if( o.indexOf(col.name) >= 0 ):
TRef(StringTools.replace(o, col.name, c.name));
case TLayer(o) if( o.indexOf(col.name) >= 0 ):
TLayer(StringTools.replace(o, col.name, c.name));
default:
t;
}
});
var newPath = c.name;
var back = newPath.split("/");
var finalPart = back.pop();
Expand Down

0 comments on commit fa4254b

Please sign in to comment.