mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Return null when locale has not been set in loocale closure. (flutter/engine#6936)
This commit is contained in:
parent
78a251625b
commit
a67d02881b
@ -42,7 +42,12 @@ void _updateWindowMetrics(double devicePixelRatio,
|
||||
|
||||
typedef _LocaleClosure = String Function();
|
||||
|
||||
String _localeClosure() => window.locale.toString();
|
||||
String _localeClosure() {
|
||||
if (window.locale == null) {
|
||||
return null;
|
||||
}
|
||||
return window.locale.toString();
|
||||
}
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
_LocaleClosure _getLocaleClosure() => _localeClosure;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user