summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/ItemUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/widgets/ItemUI.cpp')
-rw-r--r--sigmodr/widgets/ItemUI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sigmodr/widgets/ItemUI.cpp b/sigmodr/widgets/ItemUI.cpp
index 7903b94d..4dda8c51 100644
--- a/sigmodr/widgets/ItemUI.cpp
+++ b/sigmodr/widgets/ItemUI.cpp
@@ -135,7 +135,8 @@ void ItemUI::sellableChanged(const bool sellable)
void ItemUI::typeChanged(const int type)
{
- qobject_cast<Item*>(modified())->setType(game()->itemType(type)->id());
+ if (0 <= type)
+ qobject_cast<Item*>(modified())->setType(game()->itemType(type)->id());
}
void ItemUI::priceChanged(const int price)