mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
Fix potential undefined property
Not sure the reason, but I got this error:
```
Cannot read property 'id' of undefined
at tn (SongTitleField.js:35)
at Ka (react-dom.production.min.js:153)
at vl (react-dom.production.min.js:261)
at sc (react-dom.production.min.js:246)
at lc (react-dom.production.min.js:246)
```
This commit is contained in:
@@ -100,8 +100,8 @@ const SongContextMenu = ({
|
||||
}
|
||||
|
||||
SongContextMenu.propTypes = {
|
||||
resource: PropTypes.string,
|
||||
record: PropTypes.object,
|
||||
resource: PropTypes.string.isRequired,
|
||||
record: PropTypes.object.isRequired,
|
||||
onAddToPlaylist: PropTypes.func,
|
||||
visible: PropTypes.bool,
|
||||
showStar: PropTypes.bool,
|
||||
@@ -109,6 +109,8 @@ SongContextMenu.propTypes = {
|
||||
|
||||
SongContextMenu.defaultProps = {
|
||||
onAddToPlaylist: () => {},
|
||||
record: {},
|
||||
resource: 'song',
|
||||
visible: true,
|
||||
showStar: true,
|
||||
addLabel: true,
|
||||
|
||||
@@ -76,4 +76,9 @@ SongTitleField.propTypes = {
|
||||
showTrackNumbers: PropTypes.bool,
|
||||
}
|
||||
|
||||
SongTitleField.defaultProps = {
|
||||
record: {},
|
||||
showTrackNumbers: false,
|
||||
}
|
||||
|
||||
export default SongTitleField
|
||||
|
||||
Reference in New Issue
Block a user