Azure / azure-libraries-for-java

Azure Management Libraries for Java
https://docs.microsoft.com/en-us/java/azure/
MIT License
94 stars 98 forks source link

[BUG]Virtual Machine getProximityGroup throws null pointer if proximity group is null #1247

Closed mjia-r7 closed 4 years ago

mjia-r7 commented 4 years ago

Describe the bug A clear and concise description of what the bug is. Virtual Machine getProximityGroup will throw Null Pointer Exception if the virtual machine inner proximity group is null.

Exception or Stack Trace Add the exception log and stack trace if available

Caused by: java.lang.NullPointerException: null at com.microsoft.azure.management.compute.implementation.VirtualMachineImpl.proximityPlacementGroup(VirtualMachineImpl.java:1658)

To Reproduce Steps to reproduce the behavior:

call any VirtualMachine.getProximityGroup where the VirtualMachine's inner proximity group is null.

Code Snippet Add the code snippet that causes the issue. https://github.com/Azure/azure-libraries-for-java/blob/master/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java#L1702

Expected behavior A clear and concise description of what you expected to happen. Something that isn't a null pointer would be ideal.

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

Additional context Add any other context about the problem here. Unnecessary

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report