CCO: ensure state.components is always a list, not just a record

This commit is contained in:
Harald Welte 2011-12-17 18:34:47 +01:00
parent 5c0f228e11
commit 2e7ab1fe65
1 changed files with 4 additions and 2 deletions

View File

@ -363,8 +363,10 @@ process_rx_component(ISMs, Comp) ->
Prim = asn_rec_to_uprim(Comp),
gem_fsm:send_event(ISM, Prim).
add_components_to_state(State = #state{components=CompOld}, CompNew) ->
State#state{components = CompOld ++ CompNew}.
add_components_to_state(State = #state{components=CompOld}, CompNew) when is_list(CompNew) ->
State#state{components = CompOld ++ CompNew};
add_components_to_state(State, CompNew) when is_record(CompNew, component) ->
add_components_to_state(State, [CompNew]).
% get the invokeId from the given asn-record component tuple.