aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-08-01 04:42:41 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-08-01 04:42:41 +0100
commit474aa3470abb9a9bbbae137574542a6e5ac190a0 (patch)
tree66556073c0a26d2404abd274711ecd8cd4aca7f4 /gui
parent5cc5fa04a470e37c74db2b6e87a0f441d375606f (diff)
downloadnextpnr-474aa3470abb9a9bbbae137574542a6e5ac190a0.tar.gz
nextpnr-474aa3470abb9a9bbbae137574542a6e5ac190a0.tar.bz2
nextpnr-474aa3470abb9a9bbbae137574542a6e5ac190a0.zip
gui: fix crash on ecp5 gui, fix quadtree tests to not get broken by clangformat
Diffstat (limited to 'gui')
-rw-r--r--gui/treemodel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gui/treemodel.h b/gui/treemodel.h
index 3157dbab..4c3f64c3 100644
--- a/gui/treemodel.h
+++ b/gui/treemodel.h
@@ -363,10 +363,16 @@ class Model : public QAbstractItemModel
{
switch (type) {
case ElementType::BEL:
+ if (bel_root_ == nullptr)
+ return boost::none;
return bel_root_->getById(id);
case ElementType::WIRE:
+ if (wire_root_ == nullptr)
+ return boost::none;
return wire_root_->getById(id);
case ElementType::PIP:
+ if (pip_root_ == nullptr)
+ return boost::none;
return pip_root_->getById(id);
case ElementType::CELL:
return cell_root_->getById(id);