mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
handle error from invalid input
This commit is contained in:
@@ -36,6 +36,7 @@ function getItemByPath (path, setType) {
|
||||
if (setType === 'hair') {
|
||||
// itemPathParent is in this format: hair.purple
|
||||
const hairType = itemPathParent.split('.')[1];
|
||||
if (!content.appearances.hair[hairType]) return null;
|
||||
return content.appearances.hair[hairType][itemKey];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user