[polari] mainWindow: Handle undefined _subtitle
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] mainWindow: Handle undefined _subtitle
- Date: Tue, 22 Feb 2022 10:45:59 +0000 (UTC)
commit 1caed2cd7a2427faef9b54b3237c058f5272587e
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Feb 16 13:45:27 2022 +0100
mainWindow: Handle undefined _subtitle
Property bindings need to access the value before instance fields
are added. Address this by handling the case where the backing
property is undefined, and simply return the empty string.
Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/244>
src/mainWindow.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index fcd0b081..6d488679 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -231,12 +231,12 @@ export default GObject.registerClass({
}
get subtitle() {
- return this._subtitle;
+ return this._subtitle ?? '';
}
// eslint-disable-next-line camelcase
get subtitle_visible() {
- return this._subtitle.length > 0;
+ return this.subtitle.length > 0;
}
// eslint-disable-next-line camelcase
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]