diff --git a/bin/frama-c-script b/bin/frama-c-script
index a6be7954558452f567495c4f6f3ba056611e8962..3c61ac10c6d4ba98eb5d0316077a0e070926a95c 100755
--- a/bin/frama-c-script
+++ b/bin/frama-c-script
@@ -195,7 +195,7 @@ flamegraph() {
   </body>
 </html>
 EOF
-    if [ -z "$NOGUI" ]; then
+    if [ -z "${NOGUI-}" ]; then
         open_file "$out_html"
     fi
 }