Skip to content

Commit

Permalink
Fix second uncaught exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Apr 2, 2024
1 parent 8f5590c commit faaaca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion native/common/jp_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ void JPypeException::convertJavaToPython()
PyJPException_normalize(frame, prev, jcause, th);
PyException_SetCause(cause.get(), prev.keep());
}
PyException_SetTraceback(cause.get(), trace.get());
if (trace.get() != nullptr)
PyException_SetTraceback(cause.get(), trace.get());
PyException_SetCause(pyvalue.get(), cause.keep());
} catch (JPypeException& ex)
{
Expand Down
2 changes: 1 addition & 1 deletion native/python/pyjp_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void PyJPException_normalize(JPJavaFrame frame, JPPyObject exc, jthrowable th, j
{
// Attach the frame to first
JPPyObject trace = PyTrace_FromJavaException(frame, th, enclosing);
if (trace.get()!=nullptr)
if (trace.get() != nullptr)
PyException_SetTraceback(exc.get(), trace.get());

// Check for the next in the cause list
Expand Down

0 comments on commit faaaca4

Please sign in to comment.