throw when trying to create tray before app is ready

This commit is contained in:
deepak1556 2015-03-25 20:10:01 +05:30
parent 1804466334
commit e87041bcfc

View file

@ -7,6 +7,7 @@
#include <string>
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/browser.h"
#include "atom/browser/ui/tray_icon.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
@ -31,6 +32,10 @@ Tray::~Tray() {
// static
mate::Wrappable* Tray::New(const gfx::Image& image) {
if (!Browser::Get()->is_ready()) {
node::ThrowError("Cannot create Tray before app is ready");
return nullptr;
}
return new Tray(image);
}