markmal / freeship-plus-in-lazarus

FreeShip Plus in Lazarus
GNU General Public License v3.0
187 stars 35 forks source link

Crash on develop plates #81

Closed evanmcc closed 7 months ago

evanmcc commented 3 years ago

I separated all of my surfaces into different layers (with different colors, otherwise it's hard to tell if they're all on different layers). Now, whenever I try to develop plates, the program crashes with the stacktrace below:


Stacktrace:

Exception class: EObjectCheck
Message: Object reference is Nil
  $0000000000862FE5 line 1883 of Units/FreeDevelopedPatch.inc
  $0000000000880FB9 line 1340 of Units/FreeSubdivisionLayer.inc
  $000000000095A945 line 6947 of Units/FreeEdit.inc
  $0000000000542E0D line 2648 of Forms/Main.pas
  $00000000005647F0 line 124 of ../objpas/classes/action.inc
  $00000000005D0759 line 98 of include/containedaction.inc
  $00000000005D278D line 246 of include/customaction.inc
  $000000000056443C line 49 of ../objpas/classes/action.inc
  $00000000005CB389 line 86 of include/menuitem.inc
  $00000000005CBCBA line 293 of include/menuitem.inc
  $0000000000472CA2 line 602 of ../inc/objpas.inc
  $0000000000797A69 line 114 of lclmessageglue.pas
  $0000000000778125 line 3780 of gtk2proc.inc
  $0000000000810991 line 139 of gtk2wsmenus.pp
  $0000000000880FB9 line 1340 of Units/FreeSubdivisionLayer.inc
  $000000000095A945 line 6947 of Units/FreeEdit.inc
  $0000000000542E0D line 2648 of Forms/Main.pas
  $00000000005647F0 line 124 of ../objpas/classes/action.inc
  $00000000005D0759 line 98 of include/containedaction.inc
  $00000000005D278D line 246 of include/customaction.inc
  $000000000056443C line 49 of ../objpas/classes/action.inc
  $00000000005CB389 line 86 of include/menuitem.inc
  $00000000005CBCBA line 293 of include/menuitem.inc
  $0000000000472CA2 line 602 of ../inc/objpas.inc
  $0000000000797A69 line 114 of lclmessageglue.pas
  $0000000000778125 line 3780 of gtk2proc.inc
  $0000000000810991 line 139 of gtk2wsmenus.pp```
Brian-Drummond commented 2 years ago

I ran across this one today and fixed it.

Message: Object reference is Nil $0000000000862FE5 line 1883 of Units/FreeDevelopedPatch.inc

Line 1883 of Units/FreeDevelopedPatch.inc is... TmpEdges.Destroy;

Now if TmpEdges is Nil (per the exception message, there is nothing to destroy. So...

 if TmpEdges <> nil then
  begin 
    TmpEdges.Destroy; 
    TmpEdges := nil; 
  end;

and all is well.

I need to fork FreeShip-Plus on to my Github account with fixes like this and a few others, and send a pull request to @markmal but until then, this patch works for me.