Skip to content

Commit

Permalink
Fix TypeError in NetCommandFactoryJson.make_get_thread_stack_message() (
Browse files Browse the repository at this point in the history
microsoft#928)

Set startFrame and levels to 0 if None to avoid TypeError
  • Loading branch information
jgru authored and jumper047 committed Sep 30, 2022
1 parent ac360f4 commit be78b86
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,16 @@ def on_stacktrace_request(self, py_db, request):
# : :type stack_trace_arguments: StackTraceArguments
stack_trace_arguments = request.arguments
thread_id = stack_trace_arguments.threadId
start_frame = stack_trace_arguments.startFrame
levels = stack_trace_arguments.levels

if stack_trace_arguments.startFrame:
start_frame = int(stack_trace_arguments.startFrame)
else:
start_frame = 0

if stack_trace_arguments.levels:
levels = int(stack_trace_arguments.levels)
else:
levels = 0

fmt = stack_trace_arguments.format
if hasattr(fmt, 'to_dict'):
Expand Down

0 comments on commit be78b86

Please sign in to comment.