all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH flutter_frontend] PveLxcOptions: fix config.unprivileged is null behavior
Date: Mon, 16 Nov 2020 14:10:51 +0100	[thread overview]
Message-ID: <20201116131051.14007-1-a.lauterer@proxmox.com> (raw)

If config.unprivileged is null we should set it to the default (false)
so the ternary operator evaluates correctly.

Otherwise the LXC options screen shows "Failed assertion: boolean
expression must not be null" if the unprivileged config option is not
present in the config file.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 lib/widgets/pve_lxc_options_widget.dart | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/widgets/pve_lxc_options_widget.dart b/lib/widgets/pve_lxc_options_widget.dart
index f0967fb..cc5b70c 100644
--- a/lib/widgets/pve_lxc_options_widget.dart
+++ b/lib/widgets/pve_lxc_options_widget.dart
@@ -76,7 +76,8 @@ class PveLxcOptions extends StatelessWidget {
                     ),
                     ListTile(
                       title: Text("Unprivileged"),
-                      subtitle: Text(config.unprivileged ? 'Yes' : 'No'),
+                      subtitle:
+                          Text(config.unprivileged ?? false ? 'Yes' : 'No'),
                     ),
                     ListTile(
                       title: Text("Features"),
-- 
2.20.1





             reply	other threads:[~2020-11-16 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 13:10 Aaron Lauterer [this message]
2020-11-16 17:16 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116131051.14007-1-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal