Fix null pointer when logging before user info available
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
-// Copyright 2011-2012 MIT, All rights reserved
+// Copyright 2011-2018 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
@@ -83,7 +83,8 @@ public final class OdeLog extends Composite {
* @return logging availability
*/
public static final boolean isLogAvailable() {
- return AppInventorFeatures.hasDebuggingView() && Ode.getInstance().getUser().getIsAdmin();
+ return AppInventorFeatures.hasDebuggingView() &&
+ (Ode.getInstance().getUser() == null || Ode.getInstance().getUser().getIsAdmin());
}
/**
