mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-10 14:31:51 +02:00
added error check to setOnEmpty
This commit is contained in:
@@ -62,6 +62,10 @@ var fs = require('fs'),
|
||||
},
|
||||
setOnEmpty: function (field, value, callback) {
|
||||
Meta.configs.get(field, function (err, curValue) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!curValue) {
|
||||
Meta.configs.set(field, value, callback);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user