diff --git a/src/opengl.h b/src/opengl.h
index 1d5b4c6..22985f9 100644
--- a/src/opengl.h
+++ b/src/opengl.h
@@ -79,7 +79,8 @@ void gl_bindCamera(const Vec2* pos);
 // Circle drawing.
 void gl_drawCircle(const double x, const double y, const double r);
 void gl_drawCircleInRect(const double x, const double y, const double r,
-                         const double rc, const double ry, const double rw, const double rh);
+                         const double rc, const double ry, const double rw,
+                         const double rh);
 
 // Initialize/cleanup.
 int gl_init(void);
diff --git a/src/player.c b/src/player.c
index aaa41d6..1b63d35 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1178,6 +1178,10 @@ void player_targetPlanet(void) {
 
 // Attempt to land or target closest planet if no land target.
 void player_land(void) {
+  int i;
+  int tp;
+  double td, d;
+
   if(landed) {
     // Player is already landed.
     takeoff();
@@ -1211,9 +1215,10 @@ void player_land(void) {
     land(planet); // Land the player.
   } else {
     // Get nearest planet target.
-    int i;
-    int tp;
-    double td, d;
+    if(cur_system->nplanets == 0) {
+      player_message("There are no planets to land on.");
+      return;
+    }
 
     td = -1; // Temp distance.
     tp = -1; // Temp planet.