]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: fix app logo validation with no file (#10599)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Sun, 17 Aug 2025 14:19:50 +0000 (07:19 -0700)
committerGitHub <noreply@github.com>
Sun, 17 Aug 2025 14:19:50 +0000 (07:19 -0700)
src/paperless/serialisers.py

index 3398d53d1f35a1b4b9cd2e30f1a220db97cd8e1a..754a3c59444058ec44b7c604acda849d824d0a77 100644 (file)
@@ -209,7 +209,7 @@ class ApplicationConfigurationSerializer(serializers.ModelSerializer):
         return super().update(instance, validated_data)
 
     def validate_app_logo(self, file):
-        if magic.from_buffer(file.read(2048), mime=True) == "image/svg+xml":
+        if file and magic.from_buffer(file.read(2048), mime=True) == "image/svg+xml":
             reject_dangerous_svg(file)
         return file