From 9f3b466aa07e531e397fd04a546b972056648d0e Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Tue, 12 Oct 2010 12:12:54 +0100 Subject: [PATCH] This fixes tapctl.list when there are no arguments set Signed-off-by: Jon Ludlam --- tapctl/tapctl.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tapctl/tapctl.ml b/tapctl/tapctl.ml index 845cfec..bd8de51 100644 --- a/tapctl/tapctl.ml +++ b/tapctl/tapctl.ml @@ -315,10 +315,12 @@ let list ?t ctx = None) fields in let args = - match String.split ':' (List.assoc "args" assoc) with - | ty::arguments -> - Some (ty,String.concat ":" arguments) - | _ -> None + try + match String.split ':' (List.assoc "args" assoc) with + | ty::arguments -> + Some (ty,String.concat ":" arguments) + | _ -> None + with _ -> None in Some ({tapdisk_pid=int_of_string (List.assoc "pid" assoc); minor=int_of_string (List.assoc "minor" assoc)},(List.assoc "state" assoc),args) with _ -> None) lines -- 2.39.5