FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(action-bar): #5743 navController may be null by DickSmith · Pull Request #6029 · NativeScript/NativeScript · GitHub

fix(action-bar): #5743 navController may be null - #6029

Merged
tsonevn merged 4 commits into
NativeScript:masterfrom
DickSmith:issue-5743
Jul 10, 2018
Merged

tsonevn merged 4 commits into
NativeScript:masterfrom
DickSmith:issue-5743

Conversation

DickSmith commented Jul 4, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

Fix for #5743
From my own Crashlytics:
stderr: file:///app/vendor.js:1:860568: JS ERROR TypeError: null is not an object (evaluating 'a.viewControllers')

file:///app/vendor.js:1:860489
var l,p=a.viewControllers.indexOfObject(n);if(p>0&&p<a.viewControllers.count&&(t=a.viewControllers[p-1]),t)

which corresponds to:

const indexOfViewController = navController.viewControllers.indexOfObject(viewController);

further up navController is checked for truthiness:

const navigationBar = navController ? navController.navigationBar : null;

So applying same logic.

PR Checklist

From my own Crashlytics:
`stderr: file:///app/vendor.js:1:860568: JS ERROR TypeError: null is not an object (evaluating 'a.viewControllers')`
```
file:///app/vendor.js:1:860489
var l,p=a.viewControllers.indexOfObject(n);if(p>0&&p<a.viewControllers.count&&(t=a.viewControllers[p-1]),t)
```
which corresponds to:
https://github.com/NativeScript/NativeScript/blob/2fc1d8a8d4cf64e98eb98296e21564ac9b508f95/tns-core-modules/ui/action-bar/action-bar.ios.ts#L132

further up `navController` is checked for truthiness:
https://github.com/NativeScript/NativeScript/blob/2fc1d8a8d4cf64e98eb98296e21564ac9b508f95/tns-core-modules/ui/action-bar/action-bar.ios.ts#L119

So applying same logic.
ghost added the ♥ community PR label Jul 4, 2018
ns-bot added the cla: yes label Jul 4, 2018

vakrilov left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Having no navigationController/navigationBar will cause more trouble in this method here and here where there are no guards.

Can you do the check for missing navigationController in the beginning of the method and just return if the is none (the same way we do in if there is no page or frame).

DickSmith commented Jul 5, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

@vakrilov
Perfect, will do. :D

Copy link
Copy Markdown
Contributor Author

@vakrilov
Updated.

vakrilov commented Jul 5, 2018

Copy link
Copy Markdown
Contributor

test

ghost assigned vakrilov Jul 5, 2018
ghost added in progress and removed ♥ community PR labels Jul 5, 2018

Copy link
Copy Markdown
Contributor

test

Copy link
Copy Markdown
Contributor

test

lock Bot commented Aug 26, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Aug 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL