09/15/2017, 1:02 PM
@karelpeeters I haven’t tried the js version yet, but what does onClick return? If selector isn’t null, then the value of onClick is returned. So, to answer your question: No the code snippets are not identical as far as I know, it is more like:
Copy code
//code #0
    selector?.onClick(event) ?: throw ItemSelectorNotFound()

    //code #1
    if (selector != null) {
        if (selector.onClick(event) == null) {
            throw ItemSelectorNotFound()