rnewson commented on code in PR #5424: URL: https://github.com/apache/couchdb/pull/5424#discussion_r1945487893
########## src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl: ########## @@ -814,12 +814,16 @@ nouveau_add_fun(#proc{}, _) -> ok. clouseau_index_doc(#proc{} = Proc, {[_ | _]} = Doc) -> - [Fields | _] = prompt(Proc, [<<"index_doc">>, Doc]), - lists:sort(Fields). + case prompt(Proc, [<<"index_doc">>, Doc]) of + [Fields | _] -> lists:sort(Fields); + [] -> [] + end. nouveau_index_doc(#proc{} = Proc, {[_ | _]} = Doc) -> - [Fields | _] = prompt(Proc, [<<"nouveau_index_doc">>, Doc]), - lists:sort(Fields). + case prompt(Proc, [<<"nouveau_index_doc">>, Doc]) of + [Fields | _] -> lists:sort(Fields); + [] -> [] + end. Review Comment: is there a test that would fail if nouveau deviated from this? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org