{"record":{"id":"c77043cd26451d51","repo":"appsmithorg/appsmith","slug":"pe-arg-5000-c77043","errorCode":"PE-ARG-5000","errorMessage":"Appsmith server has found null query object when applying where conditional on Firestore query. Please contact Appsmith's customer support to resolve this.","messagePattern":"Appsmith server has found null query object when applying where conditional on Firestore query\\. Please contact Appsmith's customer support to resolve this\\.","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java","lineNumber":31,"sourceCode":"import org.apache.commons.lang3.StringUtils;\n\nimport java.io.IOException;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class WhereConditionUtils {\n\n    protected static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled();\n\n    public static Query applyWhereConditional(Query query, String strPath, String operatorString, String strValue)\n            throws AppsmithPluginException {\n\n        String path = strPath.trim();\n\n        if (query == null) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    FirestoreErrorMessages.WHERE_CONDITIONAL_NULL_QUERY_ERROR_MSG);\n        }\n\n        ConditionalOperator operator;\n        try {\n            operator = StringUtils.isEmpty(operatorString) ? null : ConditionalOperator.valueOf(operatorString);\n        } catch (IllegalArgumentException e) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    FirestoreErrorMessages.WHERE_CONDITION_INVALID_OPERATOR_ERROR_MSG,\n                    e.getMessage());\n        }\n\n        DataType dataType = DataTypeStringUtils.stringToKnownDataTypeConverter(strValue);\n        Object value = strValue.trim();\n\n        switch (dataType) {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java#L13-L49","documentation":"WhereConditionUtils.applyWhereConditional (WhereConditionUtils.java:30-33) throws this when the Query parameter passed to the method is null. The method is a static utility that applies a Firestore where-clause to an existing Query object — a null Query means no valid query context exists to attach the conditional to. This is categorized as PLUGIN_EXECUTE_ARGUMENT_ERROR (PE-ARG-5000). The message directs users to contact support, suggesting this is an internal error path rather than a normal user-input failure.","triggerScenarios":"applyWhereConditional is called with a null Query reference. This typically happens internally when the Firestore plugin's query-building pipeline has not yet instantiated a Query object before attempting to apply a where condition — e.g., a collection path was not resolved, or the upstream query construction returned null.","commonSituations":"1) Collection/document path missing or invalid, causing upstream Query instantiation to fail silently and pass null downstream. 2) A plugin code path that builds a query conditionally but skips Query creation for certain methods (e.g., a method that does not support where clauses). 3) Internal plugin bug where the Query is not properly initialized before where-condition application.","solutions":["Ensure the Firestore collection or document path is correctly configured so a valid Query object is created upstream.","Verify the query method selected (GET_COLLECTION vs GET_DOCUMENT vs others) supports where conditions — only collection-level queries should apply where clauses.","If the path and method look correct, this is likely an internal plugin issue — report it to Appsmith support with the full query configuration.","Check for empty or whitespace-only collection paths which may cause upstream Query creation to return null."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure collection path is non-empty before running a query with a where clause\nif (!form.collectionPath || form.collectionPath.trim() === '') {\n  showAlert('Collection path is required for where conditions', 'error');\n} else {\n  await firestoreQuery.run();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide a valid collection path so the upstream Query object is non-null.","Use collection-level methods (GET_COLLECTION) for where conditions, not document-level methods.","If this error appears with a valid path, report it as an internal plugin bug."],"tags":["firestore","where-condition","null-check","internal-error","appsmith"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}