-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes NPE: sets default color to grey instead of null if not defined in the configuration #127
base: master
Are you sure you want to change the base?
fixes NPE: sets default color to grey instead of null if not defined in the configuration #127
Conversation
…iguration (fixes NPE)
I have tested this PR by pulling in the changes locally into pte in Transportr and can confirm that it fixes #107. |
Ah sorry I should have commented this earlier. I'm not convinced that defaults should be defined in PTE. Imho, if the interface doesn't have a color it should say so (by using the value 'null') and the app should decide on a default color. What do you think? |
I wouldn't mind this being set by PTE, maybe also on a per-provider basis as the default color probably varies from provider to provider. The problem with letting the individual providers take care of it is that they don't handle the Maybe a protected |
Yes, you generally have to handle null values. There are lots of values that can be null in the PTE results. Maybe we need to add more |
I would be great if all return values that can be But I see this discussion more about where/how/if default colors should be handled. if We could make this more modular and use as an automatic fallback in other places when the color is When viewing PTE as a versatile and easy-to-use library, it would be a nice addition to provide means to set a default color that is automatically used if no color is there, so this logic does not need to be re-implemented by every single program using PTE. |
I'll try to go through the API and add There are some style defaults, but only for products that have a style default in the real world. For example, in Germany S-Bahn has this dark green rounded style. In these cases, defaults are ok. But I think PTE generally – not only for styles – should not invent values. Imho the handling of missing data is up to the app using PTE. |
63d8043
to
2e5f16d
Compare
b017ce1
to
28dd2c8
Compare
Fix to #107, with the help of @corentin38
NPE seemed to occur also on France South-West and South-East regions too.