aboutsummaryrefslogtreecommitdiffstats
path: root/src/isotp/receive.c
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 12:10:14 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 12:10:14 -0500
commitfe20a273bb3979d9e806d828486633249d073ede (patch)
tree8927587678803ad8628087e4c52f6dd30927a5d1 /src/isotp/receive.c
parent482c7eafcb35a4031ab6f2241b14ac495735b7cd (diff)
Avoid hitting a NULL pointer when using callbacks.
Diffstat (limited to 'src/isotp/receive.c')
-rw-r--r--src/isotp/receive.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/isotp/receive.c b/src/isotp/receive.c
index fa96156d..1692f8d3 100644
--- a/src/isotp/receive.c
+++ b/src/isotp/receive.c
@@ -6,7 +6,9 @@ bool isotp_handle_single_frame(IsoTpHandle* handle, IsoTpMessage* message) {
}
void isotp_complete_receive(IsoTpHandle* handle, IsoTpMessage* message) {
- handle->receive_handle.message_received_callback(message);
+ if(handle->receive_handle.message_received_callback != NULL) {
+ handle->receive_handle.message_received_callback(message);
+ }
}
IsoTpHandle isotp_receive(IsoTpShims* shims,