Skip to content

Commit

Permalink
Fix Crash on accessing invalid Flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo committed Jun 12, 2020
1 parent 167180c commit 5aa5f01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ozwadmin-widgets/node_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void Node_Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option,

QSize Node_Delegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(option);
NodeFlagsWidget fw;
fw.setValue(index.data().value<QBitArray>());
return fw.sizeHint();
Expand Down
2 changes: 1 addition & 1 deletion ozwadmin-widgets/nodeflagswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ NodeFlagsWidget::~NodeFlagsWidget()

void NodeFlagsWidget::setValue(QBitArray value) {
this->m_value = value;
for (int i = 0; i <= value.size(); i++) {
for (int i = 0; i < this->m_value.size(); i++) {
switch (i) {
case QTOZW_Nodes::nodeFlags::isAwake:
{
Expand Down

0 comments on commit 5aa5f01

Please sign in to comment.