Skip to content

Commit e6184ab

Browse files
Fixes #10093. Don't insert null tvformat into channel table.
1 parent a02927d commit e6184ab

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mythtv/libs/libmythtv/channelutil.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,16 +1593,17 @@ bool ChannelUtil::CreateChannel(uint db_mplexid,
15931593
query.bindValue(":FREQID", freqid);
15941594

15951595
QString tvformat = (atsc_minor_channel > 0) ? "ATSC" : format;
1596+
tvformat = tvformat.isNull() ? "" : tvformat;
15961597
query.bindValue(":TVFORMAT", tvformat);
15971598

1598-
icon = (icon.isEmpty()) ? "" : icon;
1599-
query.bindValue(":ICON", icon);
1599+
icon = (icon.isNull()) ? "" : icon;
1600+
query.bindValue(":ICON", icon);
16001601

1601-
xmltvid = (xmltvid.isEmpty()) ? "" : xmltvid;
1602-
query.bindValue(":XMLTVID", xmltvid);
1602+
xmltvid = (xmltvid.isNull()) ? "" : xmltvid;
1603+
query.bindValue(":XMLTVID", xmltvid);
16031604

1604-
default_authority = (default_authority.isEmpty()) ? "" : default_authority;
1605-
query.bindValue(":AUTHORITY", default_authority);
1605+
default_authority = (default_authority.isNull()) ? "" : default_authority;
1606+
query.bindValue(":AUTHORITY", default_authority);
16061607

16071608
if (!query.exec() || !query.isActive())
16081609
{

0 commit comments

Comments
 (0)