aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmllocale.cpp')
-rw-r--r--src/qml/qml/qqmllocale.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index e1ac75f5f0..c9ce4773c3 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -464,8 +464,11 @@ v8::Handle<v8::Value> QQmlNumberExtension::toLocaleString(const v8::Arguments& a
if (!args[1]->IsString())
V8THROW_ERROR("Locale: Number.toLocaleString(): Invalid arguments");
v8::Local<v8::String> fs = args[1]->ToString();
- if (!fs.IsEmpty() && fs->Length())
- format = fs->GetCharacter(0);
+ if (!fs.IsEmpty() && fs->Length()) {
+ v8::String::Value value(fs);
+ Q_ASSERT(*value != NULL);
+ format = **value;
+ }
}
int prec = 2;
if (args.Length() > 2) {