jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
450 stars 141 forks source link

App Crashes On "Connect To Server" upon back button press #65

Closed grasponcrypto closed 4 years ago

grasponcrypto commented 5 years ago

Describe the bug

App freezes on "Connect to Server" or "Sign In" screen when back button is pressed.

To Reproduce

  1. Go to "Sign In", or "Connect to Server" screen
  2. Click "back" button. (may have to click it twice)
  3. See error

Expected behavior

Either app does nothing, if no where to go - such as initial login - or app returns to previous user session if "change user" was chosen.

Logs

9-10 19:50:31.323 [scrpt.ctx.run.enter] UI: Entering 'Jellyfin', id 'dev'

------ Running dev 'Jellyfin' main ------
tracker Run
Get server details
tracker Run
Get user login
tracker Run

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Suspending threads...
Thread selected:  0*   pkg:/source/api/userauth.brs(19)        url = Substitute("Users/{0}", id)

Current Function:
017:  function AboutMe()
018:    id = get_setting("active_user")
019:*   url = Substitute("Users/{0}", id)
020:    resp = APIRequest(url)
021:    return getJson(resp)
022:  end function
Type Mismatch. (runtime error &h18) in pkg:/source/api/userauth.brs(19)
019:   url = Substitute("Users/{0}", id)
Backtrace:
#2  Function aboutme() As Dynamic
   file/line: pkg:/source/api/userauth.brs(19)
#1  Function loginflow() As Void
   file/line: pkg:/source/Main.brs(41)
#0  Function main() As Void
   file/line: pkg:/source/Main.brs(12)
Local Variables:
global           Interface:ifGlobal
m                roAssociativeArray refcnt=4 count:1
id               Invalid
url              <uninitialized>
resp             <uninitialized>
Threads:
ID    Location                                Source Code
 0*   pkg:/source/api/userauth.brs(19)        url = Substitute("Users/{0}", id)
 1    pkg:/components/TrackerTask.xml(1284)   msg = wait(0, inputPort)
 2    pkg:/components/TrackerTask.xml(1284)   msg = wait(0, inputPort)
 3    pkg:/components/TrackerTask.xml(1284)   msg = wait(0, inputPort)
  *selected  

Screenshots

Additional context

cewert commented 4 years ago

Closing this since its a part of #136

Thank you for the bug report!