Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
e7e51f5f
Commit
e7e51f5f
authored
Jun 04, 2009
by
brukie
Browse files
sanity checks
parent
86097d29
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/decklistmodel.cpp
View file @
e7e51f5f
...
...
@@ -51,8 +51,16 @@ void DeckListModel::rebuildTree()
InnerDecklistNode
*
node
=
new
InnerDecklistNode
(
currentZone
->
getName
(),
root
);
for
(
int
j
=
0
;
j
<
currentZone
->
size
();
j
++
)
{
DecklistCardNode
*
currentCard
=
dynamic_cast
<
DecklistCardNode
*>
(
currentZone
->
at
(
j
));
// XXX better sanity checking
if
(
!
currentCard
)
continue
;
QString
cardType
=
db
->
getCard
(
currentCard
->
getName
())
->
getMainCardType
();
CardInfo
*
info
=
db
->
getCard
(
currentCard
->
getName
());
QString
cardType
;
if
(
!
info
)
cardType
=
"unknown"
;
else
cardType
=
info
->
getMainCardType
();
InnerDecklistNode
*
cardTypeNode
=
dynamic_cast
<
InnerDecklistNode
*>
(
node
->
findChild
(
cardType
));
if
(
!
cardTypeNode
)
cardTypeNode
=
new
InnerDecklistNode
(
cardType
,
node
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment