https://kotlinlang.org logo
g

galex

03/11/2018, 10:28 AM
Hi, is there a more Kotlin idiomatic way to write the following:
Copy code
channel == null || channel.importance != NotificationManager.IMPORTANCE_NONE
I thought I could do:
Copy code
channel?.importance != NotificationManager.IMPORTANCE_NONE
But this crashes due to the function equals being called on null (NPE) when channel is null itself