-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: Fix null pointer exception #5113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,6 +251,7 @@ def execute(self, tool_lib_id, input_field_list, **kwargs) -> NodeResult: | |
| def tool_exec_record(self, tool_lib, all_params): | ||
| task_record_id = uuid.uuid7() | ||
| start_time = time.time() | ||
| filtered_args = all_params | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 避免 |
||
| try: | ||
| # 过滤掉 tool_init_params 中的参数 | ||
| tool_init_params = json.loads(rsa_long_decrypt(tool_lib.init_params)) if tool_lib.init_params else {} | ||
|
|
@@ -259,8 +260,6 @@ def tool_exec_record(self, tool_lib, all_params): | |
| k: v for k, v in all_params.items() | ||
| if k not in tool_init_params | ||
| } | ||
| else: | ||
| filtered_args = all_params | ||
| if [WorkflowMode.KNOWLEDGE, WorkflowMode.KNOWLEDGE_LOOP].__contains__( | ||
| self.workflow_manage.flow.workflow_mode): | ||
| source_id = self.workflow_manage.params.get('knowledge_id') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -382,10 +382,10 @@ def get_chat_record(chat_info, chat_record_id): | |
| str(chat_record.id) == str(chat_record_id)] | ||
| if chat_record_list is not None and len(chat_record_list): | ||
| return chat_record_list[-1] | ||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first() | ||
| if chat_record is None: | ||
| if not is_valid_uuid(chat_record_id): | ||
| raise ChatException(500, _("Conversation record does not exist")) | ||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first() | ||
| if chat_record is None: | ||
| if not is_valid_uuid(chat_record_id): | ||
| raise ChatException(500, _("Conversation record does not exist")) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 避免 |
||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id).first() | ||
| return chat_record | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,7 +224,7 @@ def convert_to_down_model_chunk(row_str: str, chunk_index: int): | |
| if row.get('status').__contains__("pulling"): | ||
| progress = 0 | ||
| status = DownModelChunkStatus.pulling | ||
| if 'total' in row and 'completed' in row: | ||
| if 'total' in row and 'completed' in row and row.get('total'): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 避免 |
||
| progress = (row.get('completed') / row.get('total') * 100) | ||
| elif 'error' in row: | ||
| status = DownModelChunkStatus.error | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ def execute(trigger, request=None, **kwargs): | |
| trigger_setting = trigger.get('trigger_setting') | ||
| if trigger_setting.get('token'): | ||
| token = request.META.get('HTTP_AUTHORIZATION') | ||
| if trigger_setting.get('token') != token.replace('Bearer ', ''): | ||
| if not token or trigger_setting.get('token') != token.replace('Bearer ', ''): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 避免 |
||
| raise AppAuthenticationFailed(1002, _('Authentication information is incorrect')) | ||
| is_active = trigger.get('is_active') | ||
| if not is_active: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
避免
v[0]报空指针