File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ def __call__(
119119
120120 # Handle vanilla paths as the base / current file
121121 if path .startswith ("minecraft:" ):
122- if path not in self .vanilla :
123- current .data = self . grab_vanilla ( path , json_file_type )
122+ if path not in self .vanilla and ( data := self . grab_vanilla ( path , json_file_type )) :
123+ current .data = data
124124 self .vanilla .add (path )
125125
126126 # Handle non-vanilla paths, swap conflict w/ current if no smithed rules exist
@@ -180,11 +180,16 @@ def parse_smithed_file(
180180
181181 return obj
182182
183- def grab_vanilla (self , path : str , json_file_type : type [NamespaceFile ]) -> JsonDict :
183+ def grab_vanilla (self , path : str , json_file_type : type [NamespaceFile ]) -> JsonDict | None :
184184 """Grabs the vanilla file to load as the current file (aka the base)."""
185185
186186 vanilla = self .ctx .inject (Vanilla )
187- return cast (JsonFile , vanilla .data [json_file_type ][path ]).data
187+ file = vanilla .data [json_file_type ].get (path )
188+
189+ if file is None :
190+ return None
191+
192+ return cast (JsonFile , file ).data
188193
189194 def process (self ):
190195 """Main entrypoint for smithed merge solving"""
You can’t perform that action at this time.
0 commit comments