Fix T90341: Crash opening 2.4 file with File Browser editor open
The file selection parameters (e.g. `context.space_data.params`) are expected to be unset in certain cases. Reading 2.4 files seems to be one of them. Hence, code using it should check it's set first. Also added an assert to a File Browser UI template printing a message when the parameters are unset, to help debugging the issue.
This commit is contained in:
@@ -373,6 +373,7 @@ class FILEBROWSER_PT_advanced_filter(Panel):
|
||||
def poll(cls, context):
|
||||
# only useful in append/link (library) context currently...
|
||||
return (
|
||||
context.space_data.params and
|
||||
context.space_data.params.use_library_browsing and
|
||||
panel_poll_is_upper_region(context.region) and
|
||||
not panel_poll_is_asset_browsing(context)
|
||||
@@ -423,6 +424,10 @@ class FILEBROWSER_PT_directory_path(Panel):
|
||||
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.space_data.params
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
space = context.space_data
|
||||
|
||||
Reference in New Issue
Block a user