After reviewing the details, I agree with Tartarus's response, however, I would like to delve deeper into this issue: in my perspective, handling the nullcheck inline just before sending the request may not be the most elegant solution.
If 'sideId' has the potential to be null, then it should be considered as an optional parameter. In JavaScript, undefined is the type for variables that are not defined or have no value assigned, which could lead to unexpected behavior in the code provided by the question giver. A more proactive approach would be to address this issue at the point of creating the DeviceDetail object, where a default value can be set in the class constructor to prevent any "self generated NullPointerExceptions."
Additionally, it is crucial to ensure that the backend validation processes also account for required input data. It raises concern how such a fundamental aspect of data validation could potentially be overlooked.