fix source url safe access

This commit is contained in:
Minh
2026-05-24 23:45:15 +02:00
committed by GitHub
parent 4eef9ea18e
commit aa044b4563
@@ -275,7 +275,7 @@ Singleton {
property var currentProvider: Persistent.states.booru.provider property var currentProvider: Persistent.states.booru.provider
function getWorkingImageSource(url) { function getWorkingImageSource(url) {
if (url.includes('pximg.net')) { if (url?.includes('pximg.net')) {
return `https://www.pixiv.net/en/artworks/${url.substring(url.lastIndexOf('/') + 1).replace(/_p\d+\.(png|jpg|jpeg|gif)$/, '')}`; return `https://www.pixiv.net/en/artworks/${url.substring(url.lastIndexOf('/') + 1).replace(/_p\d+\.(png|jpg|jpeg|gif)$/, '')}`;
} }
return url; return url;