- Add validation to check if strategy exists before processing
- Return user-friendly error message and redirect to result page
- Prevents TypeError: 'NoneType' object is not iterable
- Ensures Railway deployment has correct result_view.html template
- Replace role_map[key] with role_map.get(key, key) to prevent KeyError
- Affects result_view and custom routes
- Ensures backward compatibility with old strategy data
- Fixes issue where strategies with unmapped roles cause page crashes
- Split data_tw and data_us loading into separate try-catch blocks
- Add detailed logging for successful loads and errors
- Ensure variables are always initialized to empty dict on failure
- Fix potential None value issue in strategy_tw route