kshitij12345 commented on code in PR #14044:
URL: https://github.com/apache/arrow/pull/14044#discussion_r963026871


##########
cpp/src/arrow/compute/cast.cc:
##########
@@ -94,7 +94,9 @@ class CastMetaFunction : public MetaFunction {
                             const FunctionOptions* options,
                             ExecContext* ctx) const override {
     ARROW_ASSIGN_OR_RAISE(auto cast_options, ValidateOptions(options));
-    if (args[0].type()->Equals(*cast_options->to_type)) {
+    // args[0].type() could be a nullptr so check for that before
+    // we do anything with it.
+    if (args[0].type() && args[0].type()->Equals(*cast_options->to_type)) {

Review Comment:
   I think it should be done to all functions which don't support this. 
Probably worth an issue by itself?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to