Do not crash when landing module on non-filled module slot while holding alt

This commit is contained in:
DarkPhoenix
2019-04-21 23:47:21 +03:00
parent d45857f1fc
commit bde2043294

View File

@@ -450,7 +450,7 @@ class FittingView(d.Display):
dstPos = fit.modules.index(dstMod) if dstMod is not None else None
mstate = wx.GetMouseState()
# If we dropping on a module, try to replace, or add if replacement fails
if item.isModule and dstMod is not None:
if item.isModule and dstMod is not None and not dstMod.isEmpty:
positions = getSimilarModPositions(fit.modules, dstMod) if mstate.altDown else [dstPos]
command = cmd.GuiReplaceLocalModuleCommand(fitID=fitID, itemID=itemID, positions=positions)
if not self.mainFrame.command.Submit(command):