Fix null reference
FIx frontend Added modal on assistede tooling
This commit is contained in:
@@ -263,10 +263,11 @@ namespace Step.Database.Controllers
|
||||
foreach(DbNcShankModel shank in shanks)
|
||||
{
|
||||
// Populate magazinePosition shank Id
|
||||
magPos
|
||||
.Where(x => x.PositionId == shank.PositionId)
|
||||
.FirstOrDefault()
|
||||
.ShankId = shank.ShankId;
|
||||
var pos = magPos
|
||||
.FirstOrDefault(x => x.PositionId == shank.PositionId);
|
||||
|
||||
if(pos != null)
|
||||
pos.ShankId = shank.ShankId;
|
||||
}
|
||||
// Convert in DTOModel and return
|
||||
return magPos;
|
||||
@@ -276,8 +277,7 @@ namespace Step.Database.Controllers
|
||||
{
|
||||
DbNcMagazinePositionModel positions = dbCtx
|
||||
.MagazinePositions
|
||||
.Where(x => x.MagazineId == magId && x.PositionId == posId)
|
||||
.FirstOrDefault();
|
||||
.FirstOrDefault(x => x.MagazineId == magId && x.PositionId == posId);
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user