conf: handle null pointer in virNetDevVlanFormat

Other *Format() functions (e.g. virNetDevBandwidthFormat()) return
with no action when called with a NULL *Def pointer. This makes
virNetDevVlanFormat() consistent with that behavior.
This commit is contained in:
Laine Stump 2014-02-20 13:59:55 +02:00
parent 6d4ffae4fc
commit 79358733b0

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2013 Red Hat, Inc.
* Copyright (C) 2009-2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -144,7 +144,7 @@ virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf)
{
size_t i;
if (def->nTags == 0)
if (!(def && def->nTags))
return 0;
if (!def->tag) {