Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
马一丁
2025-12-19 09:56:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cb6b8f39c1149d5c1fb1b9d580a4123536da07f6
cb6b8f39
1 parent
b2c77bf3
Null pointer dereference after graph storage load failure
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
app.py
app.py
View file @
cb6b8f3
...
...
@@ -1323,6 +1323,13 @@ def get_graph_data(report_id):
graph
=
storage
.
load
(
graph_path
)
# 检查图谱是否成功加载(文件可能损坏或格式错误)
if
graph
is
None
:
return
jsonify
({
'success'
:
False
,
'message'
:
f
'图谱文件损坏或格式错误: {report_id}'
}),
500
# 转换为 Vis.js 格式
vis_nodes
=
[]
vis_edges
=
[]
...
...
@@ -1379,6 +1386,13 @@ def get_latest_graph():
graph
=
storage
.
load
(
latest_path
)
report_id
=
latest_path
.
parent
.
name
if
latest_path
.
parent
else
'unknown'
# 检查图谱是否成功加载(文件可能损坏或格式错误)
if
graph
is
None
:
return
jsonify
({
'success'
:
False
,
'message'
:
'图谱文件损坏或格式错误'
}),
500
# 转换为 Vis.js 格式
vis_nodes
=
[]
vis_edges
=
[]
...
...
@@ -1467,6 +1481,14 @@ def query_graph():
}),
404
graph
=
storage
.
load
(
graph_path
)
# 检查图谱是否成功加载(文件可能损坏或格式错误)
if
graph
is
None
:
return
jsonify
({
'success'
:
False
,
'message'
:
'图谱文件损坏或格式错误'
}),
500
query_engine
=
QueryEngine
(
graph
)
params
=
QueryParams
(
...
...
Please
register
or
login
to post a comment