diff --git a/src/Rocketeer/ConnectionsHandler.php b/src/Rocketeer/ConnectionsHandler.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/ConnectionsHandler.php
+++ b/src/Rocketeer/ConnectionsHandler.php
@@ -325,7 +325,8 @@ class ConnectionsHandler
 	public function getRepositoryBranch()
 	{
 		exec($this->scm->currentBranch(), $fallback);
-		$fallback = trim($fallback[0]) ?: 'master';
+		$fallback = array_get($fallback, 0, 'master');
+		$fallback = trim($fallback);
 		$branch   = $this->rocketeer->getOption('scm.branch') ?: $fallback;
 
 		return $branch;
Fix when current repository is not a Git repo