mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[aggParams/field] throw better error when field missing
This commit is contained in:
parent
0190cda30e
commit
1ee969c97a
1 changed files with 5 additions and 1 deletions
|
@ -53,7 +53,11 @@ export default function FieldAggParamFactory(Private) {
|
|||
* @return {undefined}
|
||||
*/
|
||||
FieldAggParam.prototype.write = function (aggConfig, output) {
|
||||
let field = aggConfig.params.field;
|
||||
let field = aggConfig.getField();
|
||||
|
||||
if (!field) {
|
||||
throw new Error(`"${aggConfig.makeLabel()}" requires a field`);
|
||||
}
|
||||
|
||||
if (field.scripted) {
|
||||
output.params.script = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue