handle case where box is not activated

This commit is contained in:
Girish Ramakrishnan
2016-04-05 12:23:27 -07:00
parent 7136de4d08
commit 1734555974
+2 -2
View File
@@ -1,5 +1,3 @@
/* jslint node: true */
'use strict';
exports = module.exports = {
@@ -200,6 +198,8 @@ function getAdminEmails(callback) {
users.getAllAdmins(function (error, admins) {
if (error) return callback(error);
if (admins.length === 0) return callback(new Error('No admins on this cloudron')); // box not activated yet
var adminEmails = [ ];
admins.forEach(function (admin) { adminEmails.push(admin.email); });