PlaylistPrint: catch Database::GetSong() exceptions
This commit is contained in:
		| @@ -125,9 +125,14 @@ PrintSongDetails(Response &r, Partition &partition, const char *uri_utf8) | |||||||
| 	if (db == nullptr) | 	if (db == nullptr) | ||||||
| 		return false; | 		return false; | ||||||
|  |  | ||||||
| 	auto *song = db->GetSong(uri_utf8, IgnoreError()); | 	const LightSong *song; | ||||||
|  | 	try { | ||||||
|  | 		song = db->GetSong(uri_utf8, IgnoreError()); | ||||||
| 		if (song == nullptr) | 		if (song == nullptr) | ||||||
| 			return false; | 			return false; | ||||||
|  | 	} catch (const std::runtime_error &e) { | ||||||
|  | 		return false; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	song_print_info(r, partition, *song); | 	song_print_info(r, partition, *song); | ||||||
| 	db->ReturnSong(song); | 	db->ReturnSong(song); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann