[fix] Prevent acces to undefined variable.

This commit is contained in:
opi 2016-05-23 15:27:46 +02:00
parent b17f1ebdce
commit 04cd9dfbf5

View file

@ -12,7 +12,7 @@
app.get('#/', function (c) { app.get('#/', function (c) {
c.api('/users', function(data) { c.api('/users', function(data) {
// Warn admin if no users are created. // Warn admin if no users are created.
if (data.users.length === 0) { if (typeof data.users !== 'undefined' && data.users.length === 0) {
c.flash('warning', y18n.t('warning_first_user')); c.flash('warning', y18n.t('warning_first_user'));
} }