# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1620613492 0 # Node ID eec926265888ff2932251a6b6ce845b5f28eb1bc # Parent d3f09b3f3703e3ac48862d7379e48ed63fb13d07 Android: Use toLongOrNull() whenever converting from string to long... To avoid any possible exceptions. diff -r d3f09b3f3703 -r eec926265888 android/DWindows.kt --- a/android/DWindows.kt Mon May 10 02:01:28 2021 +0000 +++ b/android/DWindows.kt Mon May 10 02:24:52 2021 +0000 @@ -111,7 +111,7 @@ if (event.x >= v.width - (v as EditText) .compoundDrawables[DRAWABLE_RIGHT].bounds.width() ) { - val newvalue = this.text.toString().toLong() + val newvalue = this.text.toString().toLongOrNull() if(newvalue != null) { value = newvalue + 1 @@ -130,7 +130,7 @@ } else if (event.x <= (v as EditText) .compoundDrawables[DRAWABLE_LEFT].bounds.width() ) { - val newvalue = this.text.toString().toLong() + val newvalue = this.text.toString().toLongOrNull() if(newvalue != null) { value = newvalue - 1 @@ -265,7 +265,7 @@ dialog.show() } - /** + /* * Sort, filter and display the files for the given path. */ private fun refresh(path: File?) {