[Mac][App Sandbox] app.makeSingleInstance crushes the app


#1

Using Electron 1.4.1
With App Sandbox Entitlement -> com.apple.security.app-sandbox
The app crushes if using app.makeSingleInstance:

const shouldQuit = app.makeSingleInstance(() => {
  // Someone tried to run a second instance, we should focus our window.
  if (mainWindow) {
    if (mainWindow.isMinimized()) mainWindow.restore();
    mainWindow.focus();
  }
});
if (shouldQuit) {
  app.quit();
}