Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Any usage of an undefined function in a filter triggers a red Internal JavaScript Error popup #7566

Closed
saqimtiaz opened this issue Jun 28, 2023 · 3 comments

Comments

@saqimtiaz
Copy link
Contributor

saqimtiaz commented Jun 28, 2023

Describe the bug

This code will trigger the error in v5.3.0 pre-release:

{{{ [doesnot.exist[]] }}}

The description is: Uncaught Linked List only accepts string values, not undefined.

@saqimtiaz
Copy link
Contributor Author

saqimtiaz commented Jun 28, 2023

var variableInfo = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(operator.operator,{params: params, source: source});
if(variableInfo && variableInfo.srcVariable) {
var list = variableInfo.resultList ? variableInfo.resultList : [variableInfo.text];

Both resultList and text properties of variableInfo are undefined and thus this is the value returned by the operator.

Furthermore @Jermolene, would it not be appropriate to fallback to the field[] operator, if the operator specified does have a dot character but no function with that name exists?

Otherwise filters of this form would start to fail: [draft.of[New Tiddler]] and this would be a backwards compatibility break.

@kookma
Copy link
Contributor

kookma commented Jun 28, 2023

{{{ [doesnot.exist[]] }}}

I confirm the error. Win 10, Chrome 113

@Jermolene
Copy link
Owner

Thanks @AnthonyMuscio @saqimtiaz @kookma, fix coming up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants