summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_doc.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl
index 3c4fd98c..03cc8906 100644
--- a/src/couchdb/couch_doc.erl
+++ b/src/couchdb/couch_doc.erl
@@ -128,12 +128,14 @@ from_json_obj(_Other) ->
parse_rev(Rev) when is_binary(Rev) ->
parse_rev(?b2l(Rev));
-parse_rev(Rev) ->
+parse_rev(Rev) when is_list(Rev) ->
SplitRev = lists:splitwith(fun($-) -> false; (_) -> true end, Rev),
case SplitRev of
{Pos, [$- | RevId]} -> {list_to_integer(Pos), ?l2b(RevId)};
_Else -> throw({bad_request, <<"Invalid rev format">>})
- end.
+ end;
+parse_rev(_BadRev) ->
+ throw({bad_request, <<"Invalid rev format">>}).
parse_revs([]) ->
[];