diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-07 22:35:07 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-07 22:35:07 +0000 |
commit | 7e3bba433b2ccf13390b1dec4f20450e9e17379c (patch) | |
tree | f685af3893912302ebcb70088487babf6e7876a6 | |
parent | Handle selecting nulls/optionals etc (diff) | |
download | slicer-7e3bba433b2ccf13390b1dec4f20450e9e17379c.tar.bz2 slicer-7e3bba433b2ccf13390b1dec4f20450e9e17379c.tar.xz slicer-7e3bba433b2ccf13390b1dec4f20450e9e17379c.zip |
Don't create a SqlSource for a NULL field value
-rw-r--r-- | slicer/db/sqlSelectDeserializer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/slicer/db/sqlSelectDeserializer.cpp b/slicer/db/sqlSelectDeserializer.cpp index a7dd575..b0ce145 100644 --- a/slicer/db/sqlSelectDeserializer.cpp +++ b/slicer/db/sqlSelectDeserializer.cpp @@ -96,12 +96,12 @@ namespace Slicer { rmp->Create(); for (auto col = 0u; col < columnCount; col += 1) { const DB::Column & c = cmd[col]; - SqlSourcePtr h = new SqlSource(c); - if (!h->isNull()) { + if (!c.isNull()) { auto fmpr = rmp->GetAnonChildRef([&c](Slicer::HookCommonPtr h) { return boost::iequals(c.name.raw(), h->PartName()); }); if (fmpr) { + SqlSourcePtr h = new SqlSource(c); auto fmp = fmpr->Child(); fmp->Create(); fmp->SetValue(h); |