The camera itself (hardware) is fine, it's the camera app's inability to decently measure correct exposure that is the problem. Fortunately there are lots of manual options in the menu including the ability to manually set exposure compensation. Use that and you'll get much better night photos.