[lxc-devel] [lxd/master] lxd/db/networks: Fix NULL description

stgraber on Github lxc-bot at linuxcontainers.org
Mon Oct 19 02:50:50 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201018/4a45ece9/attachment.bin>
-------------- next part --------------
From 9ba0b5a029cbf659553ff5be801afe542a97e645 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 18 Oct 2020 22:50:26 -0400
Subject: [PATCH] lxd/db/networks: Fix NULL description
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #8051

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/db/networks.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/db/networks.go b/lxd/db/networks.go
index 3b10447bde..b2549cabd5 100644
--- a/lxd/db/networks.go
+++ b/lxd/db/networks.go
@@ -72,7 +72,7 @@ func (c *ClusterTx) GetNonPendingNetworkIDs() (map[string]int64, error) {
 //
 // Pending networks are skipped.
 func (c *ClusterTx) GetNonPendingNetworks() (map[string]map[int64]api.Network, error) {
-	stmt, err := c.tx.Prepare(`SELECT projects.name, networks.id, networks.name, networks.description, networks.type, networks.state
+	stmt, err := c.tx.Prepare(`SELECT projects.name, networks.id, networks.name, coalesce(networks.description, ''), networks.type, networks.state
 		FROM networks
 		JOIN projects on projects.id = networks.project_id
 		WHERE networks.state != ?


More information about the lxc-devel mailing list