Skip to content
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

null is not a String error #17

Closed
jkarelbroer opened this issue Jul 31, 2019 · 3 comments
Closed

null is not a String error #17

jkarelbroer opened this issue Jul 31, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@jkarelbroer
Copy link

jkarelbroer commented Jul 31, 2019

Hi @aissat,
It looks like this function in the AppLocalizations class tries to replace a null value without checking:
String tr(String key, {List<String> args}) { String res = this._resolve(key, this._sentences); if (args != null) { args.forEach((String str) { res = res.replaceFirst(RegExp(r'{}'), str); }); } return res; }

Hope you can create a fix for this.

@jkarelbroer
Copy link
Author

jkarelbroer commented Aug 2, 2019

@aissat This should fix it:

String tr(String key, {List<String> args}) { String res = this._resolve(key, this._sentences); if (args != null) { args.forEach((String str) { if(str != null) { res = res.replaceFirst(RegExp(r'{}'), str); } }); } return res; }

@aissat
Copy link
Owner

aissat commented Aug 2, 2019

Hi @jkarelbroer
Really I'm busy, will try to fix it in the shortest possible time

@aissat aissat added the bug Something isn't working label Aug 2, 2019
@aissat aissat pinned this issue Aug 2, 2019
@mohabmm
Copy link

mohabmm commented Sep 9, 2019

hi @aissat if you can please fix it ..... our app depemds on it and it caused black screen issue in our app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants