diff options
| author | Zach DeCook <zachdecook@gmail.com> | 2018-12-27 21:53:46 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@gmail.com> | 2018-12-27 21:53:46 -0500 |
| commit | 297437f0bcf2bb0fc190d3ce988eb9a9c57ada5c (patch) | |
| tree | 3d2038fcb8d77bcac46fc53728bdce2e34fa8c4d /laravel | |
| parent | cd1254d6ef567c7746aacecf81e955f784d338ea (diff) | |
| download | prosongsa-297437f0bcf2bb0fc190d3ce988eb9a9c57ada5c.tar.gz | |
* Songs: Fix rendering issue when no chord is found
Diffstat (limited to 'laravel')
| -rw-r--r-- | laravel/app/Http/Controllers/SongController.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/laravel/app/Http/Controllers/SongController.php b/laravel/app/Http/Controllers/SongController.php index 6452f7a..4545896 100644 --- a/laravel/app/Http/Controllers/SongController.php +++ b/laravel/app/Http/Controllers/SongController.php @@ -151,7 +151,9 @@ class SongController extends Controller $chords["Bb"] = $chords["A#"]; $ochords = array( "C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B" ); $fromkey = trim($fromkey, 'm'); - return $ochords[($chords[$fromkey] + $integer + 24)%12]; + if ( isset( $chords[$fromkey] ) ) { + return $ochords[($chords[$fromkey] + $integer + 24)%12]; + } return false; } public function post() |
