BHoM / Grasshopper_UI

Tools for Grasshopper
GNU Lesser General Public License v3.0
16 stars 5 forks source link

Stop crash on global search when request is null #675

Closed IsakNaslundBh closed 1 year ago

IsakNaslundBh commented 1 year ago

Description:

When debugging in Grasshopper, quite often the code crashes (non-fatally) on https://github.com/BHoM/Grasshopper_UI/blob/627df5a6b09fe0bc2bcd526bd41d0535074ad893/Grasshopper_UI/Global/GlobalSearch.cs#L207

due to the request being null.

Need to add a null-check in this method for the request.

Can be slightly annoying for debugging as this can happen when you have any repository attached, as long as you have built Grasshopper yourself.

Should not be critical for production code as the whole segment is in a try-catch block, but null check should be beneficial anyway.

Steps to reproduce:

Build Grasshopper_UI Attach any BHoM solution to Grasshopper (does not have to be Grasshopper) Use grasshopper, dragging some wires etc. For me it relatively frequently crashes out on this line.

Expected behaviour:

For the null-request to be checked for and handled

Test file(s):

Happens on all files for me, no test file hence required.