diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-05-16 16:04:37 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-05-16 16:04:37 +0100 |
| commit | ffd8347b81af66c42af7811d05a7f7cd195db1e4 (patch) | |
| tree | 136a029848edb56c15cc20458439c1b3200fb54e | |
| parent | 6ea5e2fe65c8823db2fee9a11ca2a006bdb39cbb (diff) | |
| download | rabbitmq-server-git-ffd8347b81af66c42af7811d05a7f7cd195db1e4.tar.gz | |
Cope if report is not a list.
| -rw-r--r-- | src/truncate.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/truncate.erl b/src/truncate.erl index 02dba2e36a..1d69de56ac 100644 --- a/src/truncate.erl +++ b/src/truncate.erl @@ -37,11 +37,12 @@ log_event({Type, GL, {Pid, ReportType, Report}}, Params) log_event(Event, _Params) -> Event. -report([[Thing]], Params) -> report([Thing], Params); -report(List, Params) -> [case Item of - {K, V} -> {K, term(V, Params)}; - _ -> term(Item, Params) - end || Item <- List]. +report([[Thing]], Params) -> report([Thing], Params); +report(List, Params) when is_list(List) -> [case Item of + {K, V} -> {K, term(V, Params)}; + _ -> term(Item, Params) + end || Item <- List]; +report(Other, Params) -> term(Other, Params). term(Thing, {Content, Struct, ContentDec, StructDec}) -> term(Thing, true, #params{content = Content, |
