Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Crash when predicate compares value to attribute #7544

Closed

Description

@1ec5

Setting MGLVectorStyleLayer.predicate to a predicate like 4 == foo leads to an assertion failure:

caught "NSInvalidArgumentException", "*** -constantValue only defined for abstract class.  Define -[NSKeyPathExpression constantValue]!"
(
	0   CoreFoundation                      0x00007fff83b56452 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff87bb4f7e objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff83bbd41d +[NSException raise:format:] + 205
	3   Foundation                          0x00007fff851cddbd NSRequestConcreteImplementation + 229
	4   Foundation                          0x00007fff851798ce -[NSExpression constantValue] + 39
	5   Mapbox                              0x00000001050f7cb8 -[NSComparisonPredicate(MGLAdditions) mgl_filter] + 216
…

The problem is that -[NSComparisonPredicate(MGLAdditions) mgl_filter] assumes that a comparison must have a key path on the left and a constant (or nil) on the right. But NSComparisonPredicate is symmetric.

/cc @frederoni

Activity

  1. added
    iOS
    macOS
    on Dec 26, 2016
  2. added this to the ios-v3.4.0 milestone on Dec 26, 2016
  3. self-assigned this
    on Dec 26, 2016
  4. 1ec5 commented on Jan 4, 2017

    @1ec5
    ContributorAuthor

    Fixed in #7548 on the release-ios-v3.4.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

crashiOSmacOSruntime styling

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions