Avoid trying to sort licenses when there are none

Bug: 65958
Change-Id: Ia01e09af21c8279ac7f26e7ef4cd63457d45ea12