[pve-devel] [PATCH flutter_frontend 4/4] power settings: fix handling null for template status

Aaron Lauterer a.lauterer at proxmox.com
Wed Jun 23 12:04:44 CEST 2021


The template status of a guest can be null and we need to catch it.

This patch aligns that with all the other instances where we do check
the template status.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 lib/widgets/pve_qemu_power_settings_widget.dart | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/widgets/pve_qemu_power_settings_widget.dart b/lib/widgets/pve_qemu_power_settings_widget.dart
index 65b3c0c..1c1d2ed 100644
--- a/lib/widgets/pve_qemu_power_settings_widget.dart
+++ b/lib/widgets/pve_qemu_power_settings_widget.dart
@@ -26,7 +26,7 @@ class PveQemuPowerSettings extends StatelessWidget {
                 mainAxisSize: MainAxisSize.min,
                 children: <Widget>[
                   if (qemuStatus == PveResourceStatusType.stopped &&
-                      !state.currentStatus.template)
+                      !(state.currentStatus.template ?? false))
                     ListTile(
                       leading: Icon(Icons.play_arrow),
                       title: Text(
@@ -41,7 +41,7 @@ class PveQemuPowerSettings extends StatelessWidget {
                         PveResourceStatusType.paused,
                         PveResourceStatusType.suspended
                       ].contains(qemuStatus) &&
-                      !state.currentStatus.template)
+                      !(state.currentStatus.template ?? false))
                     ListTile(
                       leading: Icon(Icons.play_arrow),
                       title: Text(
-- 
2.30.2






More information about the pve-devel mailing list