fix: potential crash when setting vibrancy (#29677)

This commit is contained in:
Shelley Vohr 2021-06-16 08:39:20 +02:00 committed by GitHub
parent 81795744cf
commit 2ae7e04598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -1609,6 +1609,13 @@ describe('BrowserWindow module', () => {
w.setVibrancy('' as any);
}).to.not.throw();
});
it('does not crash if vibrancy is set to an invalid value', () => {
const w = new BrowserWindow({ show: false });
expect(() => {
w.setVibrancy('i-am-not-a-valid-vibrancy-type' as any);
}).to.not.throw();
});
});
ifdescribe(process.platform === 'darwin')('trafficLightPosition', () => {