throw when trying to create tray before app is ready
This commit is contained in:
parent
1804466334
commit
e87041bcfc
1 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "atom/browser/api/atom_api_menu.h"
|
#include "atom/browser/api/atom_api_menu.h"
|
||||||
|
#include "atom/browser/browser.h"
|
||||||
#include "atom/browser/ui/tray_icon.h"
|
#include "atom/browser/ui/tray_icon.h"
|
||||||
#include "atom/common/native_mate_converters/image_converter.h"
|
#include "atom/common/native_mate_converters/image_converter.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
|
@ -31,6 +32,10 @@ Tray::~Tray() {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
mate::Wrappable* Tray::New(const gfx::Image& image) {
|
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);
|
return new Tray(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue