treehouses / remote

⚡ control Raspberry Pi from Android Device through Bluetooth ⚡
https://play.google.com/store/apps/details?id=io.treehouses.remote
GNU Affero General Public License v3.0
64 stars 29 forks source link

Status Fragment: IndexOutOfBoundsException #526

Closed sriharivishnu closed 4 years ago

sriharivishnu commented 4 years ago

Log from Console:

java.lang.StringIndexOutOfBoundsException: 
  at java.lang.String.substring (String.java:2027)
  at io.treehouses.remote.Fragments.StatusFragment.checkUpgradeStatus (StatusFragment.java:192)
  at io.treehouses.remote.Fragments.StatusFragment.updateStatus (StatusFragment.java:132)
  at io.treehouses.remote.Fragments.StatusFragment.access$500 (StatusFragment.java:29)
  at io.treehouses.remote.Fragments.StatusFragment$5.handleMessage (StatusFragment.java:259)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7356)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)
sriharivishnu commented 4 years ago

Error comes from this line in checkUpgradeStatus: tvUpgrade.setText("Upgrade Status: Required for Version: " + outs.get(3).substring(4));

Documentation for value returned from treehouses upgrade --check: outputs true + version

If there is a StringIndexOutOfBoundsException, the version number must be empty? Or perhaps it is linked to #521 in which the order of the outputs is mixed up