diff --git a/src/Milon/Barcode/DNS2D.php b/src/Milon/Barcode/DNS2D.php
index 2642f6d..2593371 100644
--- a/src/Milon/Barcode/DNS2D.php
+++ b/src/Milon/Barcode/DNS2D.php
@@ -406,7 +406,7 @@ protected function checkfile($path) {
     }
 
     public function setStorPath($path) {
-        $this->store_path = rtrim($path, '/' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+        $this->store_path = rtrim((string) $path, '/' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
         return $this;
     }