Calling `brush.asset_save_as` both creates an asset and also activates the corresponding brush. When run while Blender is in background mode, the `active_tool->runtime` field may be null. To avoid crashing in this case, check for null when comparing active tool data. Pull Request: https://projects.blender.org/blender/blender/pulls/138245