提交 d49120e2 编写于 作者: oldratlee's avatar oldratlee 🔥

add null check

上级 5cab8170
......@@ -48,6 +48,10 @@ public final class MtContextCallable<V> implements Callable<V> {
* @return Wrapped {@link Callable}
*/
public static <T> MtContextCallable<T> get(Callable<T> callable) {
if (null == callable) {
throw new NullPointerException("input argument is null!");
}
if (callable instanceof MtContextCallable) {
return (MtContextCallable<T>) callable;
}
......
......@@ -48,6 +48,10 @@ public final class MtContextRunnable implements Runnable {
* @return Wrapped {@link Runnable}
*/
public static MtContextRunnable get(Runnable runnable) {
if (null == runnable) {
throw new NullPointerException("input argument is null!");
}
if (runnable instanceof MtContextRunnable) {
return (MtContextRunnable) runnable;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册