Skip to content

Commit

Permalink
Merge pull request #29 from unloggedio/fix/issue-614-4
Browse files Browse the repository at this point in the history
Fix for issue-614-4
  • Loading branch information
artpar authored Jan 11, 2024
2 parents a1a0658 + a716529 commit 8d791f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/io/unlogged/mocking/MockHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;

import io.unlogged.mocking.construction.JsonDeserializer;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.DynamicType;
Expand Down Expand Up @@ -176,7 +177,12 @@ public Object intercept(@AllArguments Object[] methodArguments,
// }
// Method realMethod = originalImplementation.getClass()
// .getMethod(invokedMethod.getName(), invokedMethod.getParameterTypes());
return invokedMethod.invoke(originalImplementation, methodArguments);

if (originalImplementation == null){
return null;
}

return invokedMethod.invoke(originalImplementation, methodArguments);
}

private Object createReturnValueInstance(ThenParameter thenParameter, Method invokedMethod, ClassLoader classLoader, String classNameToBeConstructed, String returnValueSerialized)
Expand Down

0 comments on commit 8d791f4

Please sign in to comment.