Skip to content

Commit

Permalink
Dont' map null exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Apr 15, 2024
1 parent 1daf236 commit c526a05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/IKVM.Runtime/JNI/JNIEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static object InvokeHelper(JNIEnv* pEnv, nint objHandle, nint methodID, JValue*
}
catch (Exception e)
{
JVM.SetPendingException(ikvm.runtime.Util.mapException(e));
JVM.SetPendingException(e);
return null;
}
}
Expand Down Expand Up @@ -2391,7 +2391,7 @@ internal static jobject NewDirectByteBuffer(JNIEnv* pEnv, IntPtr address, jlong
}
catch (Exception x)
{
JVM.SetPendingException(ikvm.runtime.Util.mapException(x));
JVM.SetPendingException(x);
return (void*)IntPtr.Zero;
}
}
Expand All @@ -2404,7 +2404,7 @@ internal static jlong GetDirectBufferCapacity(JNIEnv* pEnv, jobject buf)
}
catch (Exception x)
{
JVM.SetPendingException(ikvm.runtime.Util.mapException(x));
JVM.SetPendingException(x);
return 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.Runtime/JVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal static Exception GetPendingException()
/// <param name="e"></param>
internal static void SetPendingException(Exception e)
{
pendingException = ikvm.runtime.Util.mapException(e);
pendingException = e != null ? ikvm.runtime.Util.mapException(e) : null;
}

/// <summary>
Expand Down

0 comments on commit c526a05

Please sign in to comment.