From b73aea7f83ca005e68826659f1c62b5e2f2b13a3 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 3 Aug 2015 14:19:12 +0200 Subject: [PATCH] Create data dir if missing --- src/jsfunctions.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jsfunctions.cpp b/src/jsfunctions.cpp index a65c844..67077ef 100644 --- a/src/jsfunctions.cpp +++ b/src/jsfunctions.cpp @@ -85,6 +85,10 @@ void JsFunctions::gotJs(const QByteArray &bytes) { qWarning() << "Got empty js"; return; } + if (!QDir().mkpath(Paths::getDataLocation())) { + qCritical() << "Failed to create" << Paths::getDataLocation(); + return; + } QFile file(jsPath()); if (!file.open(QIODevice::WriteOnly)) { qWarning() << "Cannot write" << file.errorString() << file.fileName(); -- 2.39.5