neowinston
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2017
06:03 AM
roRegistrySection writing crash
I'm using roRegistrySection to save and later retried a string, but the app is crashing when trying to write or read the data. Here is the code and below is the error log:
Writing:
Reading:
Error log:
What is happening? Please help. Thank you!
Writing:
BRIGHTSCRIPT: ERROR: roRegistrySection: no plugin instance available: pkg:/components/screens/DetailsScreen/DetailsScreen.brs(122)
Function SetAuthData(userToken As String) As Void
sec = CreateObject("roRegistrySection", "Authentication")
sec.Write("UserRegistrationToken", userToken)
sec.Flush()
End Function
Reading:
Function SetAuthData(userToken As String) As Void
sec = CreateObject("roRegistrySection", "Authentication")
sec.Write("UserRegistrationToken", userToken)
sec.Flush()
End Function
Error log:
Current Function:
118: Function SetAuthData(userToken As String) As Void
119: sec = CreateObject("roRegistrySection", "Authentication")
120:* sec.Write("UserRegistrationToken", userToken)
121: sec.Flush()
122: End Function
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/components/screens/DetailsScreen/DetailsScreen.brs(120)
120: sec.Write("UserRegistrationToken", userToken)
Backtrace:
#1 Function setauthdata(usertoken As String) As Void
file/line: pkg:/components/screens/DetailsScreen/DetailsScreen.brs(120)
#0 Function onitemselected() As Void
file/line: pkg:/components/screens/DetailsScreen/DetailsScreen.brs(100)
Local Variables:
usertoken roString (2.1 was String) refcnt=1 val:"English"
global Interface:ifGlobal
m roAssociativeArray refcnt=3 count:6
sec Invalid
Threads:
ID Location Source Code
0 pkg:/source/main.brs(21) msg = wait(0, port)
1* ...ailsScreen/DetailsScreen.brs(120) sec.Write("UserRegistrationToken", userToken)
*selected
What is happening? Please help. Thank you!
2 REPLIES 2
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2017
01:21 PM
Re: roRegistrySection writing crash
What's happening is that CreateObject("roRegistrySection", "Authentication") is returning invalid. If I had to guess, I'd say you're trying to call it in some node that is not a Task node.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
neowinston
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2017
01:42 PM
Re: roRegistrySection writing crash
I changed it to a Task node and now it's working! Thanks for your help!