Skip to content

Commit

Permalink
fix bug where addCharacter causes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nagolinc committed Feb 21, 2021
1 parent cd58c11 commit b9fbbf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manuskript/models/characterModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ def addCharacter(self, name="New character"):
Creates a new character
@return: the character
"""
if not name:
name="New Character"
c = Character(model=self, name=self.tr(name))
self.beginInsertRows(QModelIndex(), len(
self.characters), len(self.characters))
Expand Down
2 changes: 2 additions & 0 deletions manuskript/models/plotModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def currentIndex(self):
###############################################################################

def addPlot(self, name="New plot"):
if not name:
name="New Plot"
p = QStandardItem(self.tr(name))
_id = QStandardItem(self.getUniqueID())
importance = QStandardItem(str(0))
Expand Down

0 comments on commit b9fbbf2

Please sign in to comment.