<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9160">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fsm: guard action callback<br><br>The FSM allows to set individual action callback functions for each<br>state but it does not allow to leave the action callback pointer<br>unpopulated. However, there are cornercases where having no callback<br>function is desirable.<br><br>- Check if action callback is popolated before executing it.<br><br>Change-Id: I36d221c973d3890721ef1d376fb9be82c4311378<br>---<br>M src/fsm.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/9160/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/fsm.c b/src/fsm.c</span><br><span>index ae2fdc2..0370f65 100644</span><br><span>--- a/src/fsm.c</span><br><span>+++ b/src/fsm.c</span><br><span>@@ -541,7 +541,9 @@</span><br><span>                         osmo_fsm_event_name(fsm, event));</span><br><span>                return -1;</span><br><span>   }</span><br><span style="color: hsl(0, 100%, 40%);">-       fs->action(fi, event, data);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     if (fs->action)</span><br><span style="color: hsl(120, 100%, 40%);">+            fs->action(fi, event, data);</span><br><span> </span><br><span>  return 0;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9160">change 9160</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9160"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I36d221c973d3890721ef1d376fb9be82c4311378 </div>
<div style="display:none"> Gerrit-Change-Number: 9160 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>