-
-
Notifications
You must be signed in to change notification settings - Fork 154
Fixed error if API version not received. #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix looks ok, but as noted via slack there is the possibility for an infinite loop which is currently unhandled.
@hydra: I found a simple way to fix the infinite loop issue - now the behaviour is that if there are no pages with a suitable version found, the script cycles through all of the unsuitable pages as if there was no check. I don't think there is a way for the script to self-terminate - the ui routine will just be called over and over again. |
Still looking at this... since Will keep digging.. |
src/SCRIPTS/BF/ui.lua
Outdated
while Page == nil do | ||
Page = assert(loadScript(radio.templateHome .. PageFiles[currentPage]))() | ||
if Page.requiredVersion and Page.requiredVersion > apiVersion then | ||
if Page.requiredVersion and apiVersion and Page.requiredVersion > apiVersion and currentPage ~= nextPage then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apiVersion
will always evaluate to true if it is not nil.
> x = 0
> if x then print(1) end
1
Given that apiVersion
is initialized as 0 and is never nil, the boolean check for this variable will always be true
apiVersion = 0 |
Perhaps nesting currentPage ~= nextPage
within this if statement would permit a way to gracefully exit when they are equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added exiting if no valid pages are found.
Anybody in for a review? |
didnt work on X9D, apiversion still not received. Within data initialized in ui works. |
No description provided.