Skip to content

Commit

Permalink
ftr/PartsInGoToMenu: fix handling if parts have no id
Browse files Browse the repository at this point in the history
if parts had no id, the parts menu would have been shown but not clickable because the parts could ne be referenced.
this prevents breaking for some sources.
  • Loading branch information
Tobias Bachmann committed Dec 12, 2024
1 parent 3e4992f commit 4d3e072
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/view/window/source/SourceView.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ Ext.define('EdiromOnline.view.window.source.SourceView', {

// iterate over submitted movements and push them to movementItems variable
movements.data.each(function(movement) {
if(movement.data.parts.length === 0) {
// check if parts exist and if they have ids
if(movement.data.parts.length === 0 || movement.data.parts[0].id === null || movement.data.parts[0].id === "") {
movementItems.push({
text: movement.get('name'),
handler: Ext.bind(me.gotoMovement, me, movement.get('id'), true)
Expand Down

0 comments on commit 4d3e072

Please sign in to comment.